We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b66afa9 commit db2235aCopy full SHA for db2235a
contracts/BytesLib.sol
@@ -234,7 +234,11 @@ library BytesLib {
234
pure
235
returns (bytes memory)
236
{
237
- require(_length + 31 >= _length, "slice_overflow");
+ // We're using the unchecked block below because otherwise execution ends
238
+ // with the native overflow error code.
239
+ unchecked {
240
+ require(_length + 31 >= _length, "slice_overflow");
241
+ }
242
require(_bytes.length >= _start + _length, "slice_outOfBounds");
243
244
bytes memory tempBytes;
0 commit comments