From 734084643447ce481732640715ac8d865bc1f4a5 Mon Sep 17 00:00:00 2001 From: Dean Eigenmann <7621705+decanus@users.noreply.github.com> Date: Mon, 17 Jun 2024 17:40:25 +0200 Subject: [PATCH] fix potential panic --- common/math/big.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/math/big.go b/common/math/big.go index 721b297c9c..2444cca737 100644 --- a/common/math/big.go +++ b/common/math/big.go @@ -54,7 +54,7 @@ func NewHexOrDecimal256(x int64) *HexOrDecimal256 { // It is similar to UnmarshalText, but allows parsing real decimals too, not just // quoted decimal strings. func (i *HexOrDecimal256) UnmarshalJSON(input []byte) error { - if len(input) > 0 && input[0] == '"' { + if len(input) > 2 && input[0] == '"' { input = input[1 : len(input)-1] } return i.UnmarshalText(input)