Fix length check when decoding error data.

This commit is contained in:
chriseth 2020-12-22 11:05:02 +01:00
parent b965446182
commit 0437ee7ad9
2 changed files with 2 additions and 1 deletions

View File

@ -8,6 +8,7 @@ Compiler Features:
* SMTChecker: Support ABI functions as uninterpreted functions.
Bugfixes:
* Code Generator: Fix length check when decoding malformed error data in catch clause.
* SMTChecker: Fix false negatives in overriding modifiers.
### 0.8.0 (2020-12-16)

View File

@ -4031,7 +4031,7 @@ string YulUtilFunctions::tryDecodeErrorMessageFunction()
if gt(length, 0xffffffffffffffff) { leave }
let end := add(add(msg, 0x20), length)
if gt(end, add(data, returndatasize())) { leave }
if gt(end, add(data, sub(returndatasize(), 4))) { leave }
mstore(<freeMemoryPointer>, add(add(msg, 0x20), <roundUp>(length)))
ret := msg