From 3830fa0c93124d4071ef75e7db4d4a02441a4e55 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 10 Dec 2025 18:00:51 +0100 Subject: [PATCH] fix: validate closing quote in HexOrDecimal64.UnmarshalJSON --- 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 dfcb0aecc4..193d95bec2 100644 --- a/common/math/integer.go +++ b/common/math/integer.go @@ -30,7 +30,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) > 1 && input[0] == '"' { + if len(input) >= 2 && input[0] == '"' && input[len(input)-1] == '"' { input = input[1 : len(input)-1] } return i.UnmarshalText(input)