ethereumjs-abi icon indicating copy to clipboard operation
ethereumjs-abi copied to clipboard

rawEncode silently accepts invalid hex strings

Open lionello opened this issue 6 years ago • 1 comments

Actual

$ node
> require('ethereumjs-abi').rawEncode(["uint256"], "g")
<Buffer 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10>

The string "g" gets interpreted as "f"+1.

Expected

Calling rawEncode with invalid number or hex string should throw.

lionello avatar May 23 '18 05:05 lionello

Maybe check value in this function: encodeSingle ?

sc0Vu avatar Jan 10 '19 05:01 sc0Vu