Skip to content
low Input Validation No SWC entry CWE-20

Short Address / Calldata Padding (legacy)

SAFE-0089 Input Validation Checked automatically by the scanner
1

What goes wrong

Legacy ERC-20 clients could send under-padded calldata; the EVM zero-pads it, shifting parameters (e.g. inflating an amount). Mostly mitigated by modern compilers/ABI decoding but relevant for hand-rolled calldata parsing.

2

How to fix it

the pattern that is safe
require(msg.data.length >= EXPECTED, "short calldata"); // when parsing manually
Validate calldata length in low-level parsing.
Check your own contract for this

The SaferICO scanner runs 201 detectors over your Solidity source, SAFE-0089 among them. Paste an address or the source itself — a small per-scan fee, shown before you sign, or unlimited on any plan.

Run the scanner See how it is attacked Read the docs