Skip to content

Commit a0c6c18

Browse files
authored
Merge pull request #227 from daria-kay/leading-spaces
fixing the oss-fuzz issue
2 parents bf062a1 + 817f639 commit a0c6c18

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

parser.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ func findTokenStart(data []byte, token byte) int {
5050

5151
func findKeyStart(data []byte, key string) (int, error) {
5252
i := nextToken(data)
53+
if i == -1 {
54+
return i, KeyPathNotFoundError
55+
}
5356
ln := len(data)
5457
if ln > 0 && (data[i] == '{' || data[i] == '[') {
5558
i += 1

0 commit comments

Comments
 (0)