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: Martin Holst Swende <martin@swende.se>
pull/26129/head
Nicolas Gotchac 2 years ago committed by GitHub
parent 17744639da
commit 111ed1af1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      accounts/abi/abi.go

@ -87,7 +87,7 @@ func (abi ABI) getArguments(name string, data []byte) (Arguments, error) {
var args Arguments
if method, ok := abi.Methods[name]; ok {
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
}

Loading…
Cancel
Save