File tree 2 files changed +20
-3
lines changed
main/java/org/codehaus/jettison/json
test/java/org/codehaus/jettison/json
2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -192,7 +192,6 @@ public char nextClean() throws JSONException {
192
192
if (next () == '/' ) {
193
193
break ;
194
194
}
195
- back ();
196
195
}
197
196
}
198
197
break ;
Original file line number Diff line number Diff line change @@ -43,6 +43,24 @@ public void testEscapingInArrayIsTrunedOff() throws JSONException {
43
43
String expectedValue = "[\" a string with / character\" ,{\" key\" :\" http://example.com/foo\" }]" ;
44
44
assertEquals (expectedValue , array .toString ());
45
45
}
46
-
47
-
46
+
47
+ public void testInfiniteLoop () {
48
+ String str = "[*/*A25] **" ;
49
+ try {
50
+ new JSONArray (str );
51
+ fail ("Failure expected on malformed JSON" );
52
+ } catch (JSONException ex ) {
53
+ // expected
54
+ }
55
+ }
56
+
57
+ public void testInfiniteLoop2 () {
58
+ String str = "[/" ;
59
+ try {
60
+ new JSONArray (str );
61
+ fail ("Failure expected on malformed JSON" );
62
+ } catch (JSONException ex ) {
63
+ // expected
64
+ }
65
+ }
48
66
}
You can’t perform that action at this time.
0 commit comments