Merge pull request #12907 from ethereum/calldataReencodeValidationBug

Calldatasize-check during ABI encoding from calldata values with nested dynamic arrays.
This commit is contained in:
Daniel Kirchner
2022-05-12 17:56:44 +02:00
committed by GitHub
9 changed files with 138 additions and 5 deletions
+1 -1
View File
@@ -1454,7 +1454,7 @@ string ABIFunctions::calldataAccessFunction(Type const& _type)
length := calldataload(value)
value := add(value, 0x20)
if gt(length, 0xffffffffffffffff) { <revertStringLength>() }
if sgt(base_ref, sub(calldatasize(), mul(length, <calldataStride>))) { <revertStringStride>() }
if sgt(value, sub(calldatasize(), mul(length, <calldataStride>))) { <revertStringStride>() }
)")
("calldataStride", toCompactHexWithPrefix(arrayType->calldataStride()))
// TODO add test