Skip to content

Commit 2df846e

Browse files
committed
Merge branch 'python-regex-parsing-consistency-checks' of github.com:yoff/codeql into python-regex-parsing-consistency-checks
2 parents 54e65ce + 61bbdde commit 2df846e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/ql/src/semmle/python/regex.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ abstract class RegexString extends Expr {
397397

398398
pragma[inline]
399399
private predicate isOctal(int index) {
400-
this.getChar(index) in ["0", "1", "2", "3", "4", "5", "6", "7"]
400+
this.getChar(index) in [0..7].toString()
401401
}
402402

403403
/** Holds if `index` is inside a character set. */
@@ -709,7 +709,7 @@ abstract class RegexString extends Expr {
709709
value = svalue.toInt() and
710710
// value is composed of digits
711711
forall(int i | i in [start + 1 .. start + len - 1] |
712-
this.getChar(i) in ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
712+
this.getChar(i) in [0..9].toString()
713713
) and
714714
// a longer reference is not possible
715715
not (

0 commit comments

Comments
 (0)