File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
javascript/ql/test/query-tests/Security/CWE-020/SuspiciousRegexpRange
shared/regex/codeql/regex Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -27,4 +27,6 @@ var overlapsWithClass1 = /[0-9\d]/; // NOT OK
2727var overlapsWithClass2 = / [ \w , . - ? : * + ] / ; // NOT OK
2828
2929var tst2 = / ^ ( [ ァ - ヾ ] | [ ァ - ン ゙ ゚ ] ) + $ / ; // OK
30- var tst3 = / [ 0 - 9 0 - 9 ] / ; // OK
30+ var tst3 = / [ 0 - 9 0 - 9 ] / ; // OK
31+
32+ var question = / [ 0 - ? ] / ; // OK. matches one of: 0123456789:;<=>?
Original file line number Diff line number Diff line change @@ -129,6 +129,9 @@ module Make<RegexTreeViewSig TreeImpl> {
129129 or
130130 // starting from the zero byte is a good indication that it's purposely matching a large range.
131131 result .isRange ( 0 .toUnicode ( ) , _)
132+ or
133+ // the range 0123456789:;<=>? is intentional
134+ result .isRange ( "0" , "?" )
132135 }
133136
134137 /** Gets a char between (and including) `low` and `high`. */
You can’t perform that action at this time.
0 commit comments