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>
This commit is contained in:
parent
17744639da
commit
111ed1af1b
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue