Fix length check when decoding error data.

This commit is contained in:
chriseth committed 2020-12-22 11:08:44 +01:00
1 parent b965446182
commit 0437ee7ad9
2 files changed
+2 -1

No files matched your search

+1 -1
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