File tree 3 files changed +29
-1
lines changed
main/java/com/jayway/jsonpath/internal/path
test/java/com/jayway/jsonpath
3 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -625,7 +625,11 @@ private boolean readBracketPropertyToken(PathTokenAppender appender) {
625
625
fail ("Property has not been closed - missing closing " + potentialStringDelimiter );
626
626
}
627
627
628
- int endBracketIndex = path .indexOfNextSignificantChar (endPosition , CLOSE_SQUARE_BRACKET ) + 1 ;
628
+ int endBracketIndex = path .indexOfNextSignificantChar (endPosition , CLOSE_SQUARE_BRACKET );
629
+ if (endBracketIndex == -1 ) {
630
+ fail ("Property has not been closed - missing closing ]" );
631
+ }
632
+ endBracketIndex ++;
629
633
630
634
path .setPosition (endBracketIndex );
631
635
Original file line number Diff line number Diff line change
1
+ package com .jayway .jsonpath ;
2
+
3
+ import org .junit .Test ;
4
+
5
+ import static org .assertj .core .api .Assertions .assertThatNoException ;
6
+
7
+ public class Issue_970 {
8
+ @ Test
9
+ public void shouldNotCauseStackOverflow () {
10
+ assertThatNoException ().isThrownBy (() -> Criteria .where ("[']'," ));
11
+ }
12
+ }
Original file line number Diff line number Diff line change
1
+ package com .jayway .jsonpath ;
2
+
3
+ import org .junit .Test ;
4
+
5
+ import static org .assertj .core .api .Assertions .*;
6
+
7
+ public class Issue_973 {
8
+ @ Test
9
+ public void shouldNotCauseStackOverflow () {
10
+ assertThatNoException ().isThrownBy (() -> Criteria .parse ("@[\" \" ,/\\ " ));
11
+ }
12
+ }
You can’t perform that action at this time.
0 commit comments