Use calldatacopy for selector retrieval to avoid access out of bounds for calldata.

This commit is contained in:
chriseth
2020-06-12 13:02:57 -05:00
committed by Alexander Arlt
parent f4fc095ae0
commit c8d95d601e
4 changed files with 250 additions and 84 deletions
@@ -28,7 +28,9 @@ object \"C_6\" {
if iszero(lt(calldatasize(), 4))
{
let selector := shift_right_224_unsigned(calldataload(0))
mstore(0, 0)
calldatacopy(28, 0, 4)
let selector := mload(0)
switch selector
case 0x26121ff0