Decode: fix index out of range bug (#716)

Fixes #715
This commit is contained in:
Cameron Moore
2021-12-29 07:49:33 -06:00
committed by GitHub
parent d58eb50ebf
commit 892df5c28e
2 changed files with 16 additions and 0 deletions
+4
View File
@@ -400,6 +400,10 @@ func checkAndRemoveUnderscoresIntegers(b []byte) ([]byte, error) {
start++
}
if len(b) == start {
return b, nil
}
if b[start] == '_' {
return nil, newDecodeError(b[start:start+1], "number cannot start with underscore")
}