Skip to content

SEC-22 CALLDATACOPY does not write zero to memory if input data offset exceeds input data size #496

Closed
@Gustav-Simonsson

Description

@Gustav-Simonsson

According to YP definition of CALLDATACOPY (0x37) if the input data offset exceeds the length of the input data size (input data passed with message call or tx (Td) then 0 should be written to memory.

Currently instead of writing 0 there is a no op due to the Set function at https://github.com/ethereum/go-ethereum/blob/develop/vm/memory.go#L14 not doing anything if the length of the write is 0.

Fix: remove the offset argument overflow and ensure data is copied up until the end of input data, and then copy zeroes until the end of the supplied offset.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions