Unverified Commit 111ed1af authored by Nicolas Gotchac's avatar Nicolas Gotchac Committed by GitHub

accounts/abi: properly quote untrusted data in error message (#26110)

* abi: Format data as hex-string instead of string(data)

* Update accounts/abi/abi.go
Co-authored-by: 's avatarMartin Holst Swende <martin@swende.se>
parent 17744639
...@@ -87,7 +87,7 @@ func (abi ABI) getArguments(name string, data []byte) (Arguments, error) { ...@@ -87,7 +87,7 @@ func (abi ABI) getArguments(name string, data []byte) (Arguments, error) {
var args Arguments var args Arguments
if method, ok := abi.Methods[name]; ok { if method, ok := abi.Methods[name]; ok {
if len(data)%32 != 0 { if len(data)%32 != 0 {
return nil, fmt.Errorf("abi: improperly formatted output: %s - Bytes: [%+v]", string(data), data) return nil, fmt.Errorf("abi: improperly formatted output: %q - Bytes: %+v", data, data)
} }
args = method.Outputs args = method.Outputs
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment