Skip to content

Commit 592464d

Browse files
committed
simplify the overlap computation
1 parent aae3e2d commit 592464d

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

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

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,11 @@ predicate overlap(RegExpCharacterRange a, RegExpCharacterRange b) {
4444
a = clz.getAChild() and
4545
b = clz.getAChild()
4646
|
47-
// b contains the lower end of a
4847
exists(int alow, int ahigh, int blow, int bhigh |
4948
isRange(a, alow, ahigh) and
5049
isRange(b, blow, bhigh) and
51-
blow <= alow and
52-
bhigh >= ahigh
53-
)
54-
or
55-
// b contains the upper end of a
56-
exists(int blow, int bhigh, int alow, int ahigh |
57-
isRange(a, alow, ahigh) and
58-
isRange(b, blow, bhigh) and
59-
blow <= ahigh and
60-
bhigh >= ahigh
50+
alow <= bhigh and
51+
blow <= ahigh
6152
)
6253
)
6354
or

0 commit comments

Comments
 (0)