-
-
Notifications
You must be signed in to change notification settings - Fork 76
Closed
Labels
Description
Same as
netplex/json-smart-v1#10
The code base is at
json-smart-v2/json-smart/src/main/java/net/minidev/json/parser/JSONParserByteArray.java
Lines 77 to 82 in 00955f7
protected int indexOf(char c, int pos) { | |
for (int i = pos; pos < len; i++) | |
if (in[i] == (byte) c) | |
return i; | |
return -1; | |
} |
It shouldn't be the pos
to be checked less than len
. Instead, the i
should be checked. The correct way in line 79 is:
for (int i = pos; i < len; i++)
Any input with unclosed single quotation mark could trigger this. Like the input of 'c
, cause the ArrayIndexOutOfBoundsException