Skip to content

Commit 3a4a343

Browse files
committed
fix some QL-for-QL warnings
1 parent b54f037 commit 3a4a343

File tree

7 files changed

+26
-12
lines changed

7 files changed

+26
-12
lines changed

java/ql/lib/semmle/code/java/security/regexp/SuperlinearBackTracking.qll

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,12 @@ int distBackFromEnd(StateTuple r, StateTuple end) =
267267
* and there is a distance of `dist` from `tuple` to the nearest end-tuple `(pivot, succ, succ)`,
268268
* and a path from a start-state to `tuple` follows the transitions in `trace`.
269269
*/
270-
private predicate isReachableFromStartTuple(State pivot, State succ, StateTuple r, Trace w, int rem) {
270+
private predicate isReachableFromStartTuple(
271+
State pivot, State succ, StateTuple tuple, Trace trace, int dist
272+
) {
271273
exists(InputSymbol s1, InputSymbol s2, InputSymbol s3, Trace v |
272-
isReachableFromStartTuple(pivot, succ, v, s1, s2, s3, r, rem) and
273-
w = Step(s1, s2, s3, v)
274+
isReachableFromStartTuple(pivot, succ, v, s1, s2, s3, tuple, dist) and
275+
trace = Step(s1, s2, s3, v)
274276
)
275277
}
276278

javascript/ql/lib/semmle/javascript/security/BadTagFilterQuery.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import regexp.RegexpMatching
77
/**
88
* Holds if the regexp `root` should be tested against `str`.
99
* Implements the `isRegexpMatchingCandidateSig` signature from `RegexpMatching`.
10+
* `ignorePrefix` toggles whether the regular expression should be treated as accepting any prefix if it's unanchored.
11+
* `testWithGroups` toggles whether it's tested which groups are filled by a given input string.
1012
*/
1113
private predicate isBadTagFilterCandidate(
1214
RootTerm root, string str, boolean ignorePrefix, boolean testWithGroups

javascript/ql/lib/semmle/javascript/security/regexp/SuperlinearBackTracking.qll

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,12 @@ int distBackFromEnd(StateTuple r, StateTuple end) =
267267
* and there is a distance of `dist` from `tuple` to the nearest end-tuple `(pivot, succ, succ)`,
268268
* and a path from a start-state to `tuple` follows the transitions in `trace`.
269269
*/
270-
private predicate isReachableFromStartTuple(State pivot, State succ, StateTuple r, Trace w, int rem) {
270+
private predicate isReachableFromStartTuple(
271+
State pivot, State succ, StateTuple tuple, Trace trace, int dist
272+
) {
271273
exists(InputSymbol s1, InputSymbol s2, InputSymbol s3, Trace v |
272-
isReachableFromStartTuple(pivot, succ, v, s1, s2, s3, r, rem) and
273-
w = Step(s1, s2, s3, v)
274+
isReachableFromStartTuple(pivot, succ, v, s1, s2, s3, tuple, dist) and
275+
trace = Step(s1, s2, s3, v)
274276
)
275277
}
276278

python/ql/lib/semmle/python/security/BadTagFilterQuery.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import regexp.RegexpMatching
77
/**
88
* Holds if the regexp `root` should be tested against `str`.
99
* Implements the `isRegexpMatchingCandidateSig` signature from `RegexpMatching`.
10+
* `ignorePrefix` toggles whether the regular expression should be treated as accepting any prefix if it's unanchored.
11+
* `testWithGroups` toggles whether it's tested which groups are filled by a given input string.
1012
*/
1113
private predicate isBadTagFilterCandidate(
1214
RootTerm root, string str, boolean ignorePrefix, boolean testWithGroups

python/ql/lib/semmle/python/security/regexp/SuperlinearBackTracking.qll

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,12 @@ int distBackFromEnd(StateTuple r, StateTuple end) =
267267
* and there is a distance of `dist` from `tuple` to the nearest end-tuple `(pivot, succ, succ)`,
268268
* and a path from a start-state to `tuple` follows the transitions in `trace`.
269269
*/
270-
private predicate isReachableFromStartTuple(State pivot, State succ, StateTuple r, Trace w, int rem) {
270+
private predicate isReachableFromStartTuple(
271+
State pivot, State succ, StateTuple tuple, Trace trace, int dist
272+
) {
271273
exists(InputSymbol s1, InputSymbol s2, InputSymbol s3, Trace v |
272-
isReachableFromStartTuple(pivot, succ, v, s1, s2, s3, r, rem) and
273-
w = Step(s1, s2, s3, v)
274+
isReachableFromStartTuple(pivot, succ, v, s1, s2, s3, tuple, dist) and
275+
trace = Step(s1, s2, s3, v)
274276
)
275277
}
276278

ruby/ql/lib/codeql/ruby/security/BadTagFilterQuery.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import regexp.RegexpMatching
77
/**
88
* Holds if the regexp `root` should be tested against `str`.
99
* Implements the `isRegexpMatchingCandidateSig` signature from `RegexpMatching`.
10+
* `ignorePrefix` toggles whether the regular expression should be treated as accepting any prefix if it's unanchored.
11+
* `testWithGroups` toggles whether it's tested which groups are filled by a given input string.
1012
*/
1113
private predicate isBadTagFilterCandidate(
1214
RootTerm root, string str, boolean ignorePrefix, boolean testWithGroups

ruby/ql/lib/codeql/ruby/security/regexp/SuperlinearBackTracking.qll

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,12 @@ int distBackFromEnd(StateTuple r, StateTuple end) =
267267
* and there is a distance of `dist` from `tuple` to the nearest end-tuple `(pivot, succ, succ)`,
268268
* and a path from a start-state to `tuple` follows the transitions in `trace`.
269269
*/
270-
private predicate isReachableFromStartTuple(State pivot, State succ, StateTuple r, Trace w, int rem) {
270+
private predicate isReachableFromStartTuple(
271+
State pivot, State succ, StateTuple tuple, Trace trace, int dist
272+
) {
271273
exists(InputSymbol s1, InputSymbol s2, InputSymbol s3, Trace v |
272-
isReachableFromStartTuple(pivot, succ, v, s1, s2, s3, r, rem) and
273-
w = Step(s1, s2, s3, v)
274+
isReachableFromStartTuple(pivot, succ, v, s1, s2, s3, tuple, dist) and
275+
trace = Step(s1, s2, s3, v)
274276
)
275277
}
276278

0 commit comments

Comments
 (0)