Commit e3f71fa5 authored by Alina's avatar Alina Committed by GitHub

critical bounds bug (#82)

from: github.com/GNSPS/solidity-bytes-utils/blob/feat/update-0.7.0/contracts/BytesLib.sol
parent 66e55e89
...@@ -97,7 +97,9 @@ library Lib_BytesUtils { ...@@ -97,7 +97,9 @@ library Lib_BytesUtils {
pure pure
returns (bytes memory) returns (bytes memory)
{ {
require(_bytes.length >= (_start + _length), "Read out of bounds"); require(_length + 31 >= _length, "slice_overflow");
require(_start + _length >= _start, "slice_overflow");
require(_bytes.length >= _start + _length, "slice_outOfBounds");
bytes memory tempBytes; bytes memory tempBytes;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment