From fe49856ea7100501024dcb907924b0ffc859e71d Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Mon, 17 Jun 2024 20:18:23 +0200 Subject: [PATCH] common/math: fix flaw in HexOrDecimal64 --- common/math/integer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/math/integer.go b/common/math/integer.go index 080fba8fea..82de96f927 100644 --- a/common/math/integer.go +++ b/common/math/integer.go @@ -46,7 +46,7 @@ type HexOrDecimal64 uint64 // It is similar to UnmarshalText, but allows parsing real decimals too, not just // quoted decimal strings. func (i *HexOrDecimal64) UnmarshalJSON(input []byte) error { - if len(input) > 0 && input[0] == '"' { + if len(input) > 1 && input[0] == '"' { input = input[1 : len(input)-1] } return i.UnmarshalText(input)