Skip to content

Commit

Permalink
Merge pull request #15435 from erik-krogh/remove-at-to-z
Browse files Browse the repository at this point in the history
remove an FP in overly-large-range for [@-Z]
  • Loading branch information
erik-krogh authored Jan 25, 2024
2 parents 2333b8d + 396da11 commit fb11e4e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@ var overlapsWithClass2 = /[\w,.-?:*+]/; // NOT OK
var tst2 = /^([-]|[-])+$/; // OK
var tst3 = /[0-9-]/; // OK

var question = /[0-?]/; // OK. matches one of: 0123456789:;<=>?
var question = /[0-?]/; // OK. matches one of: 0123456789:;<=>?

var atToZ = /[@-Z]/; // OK. matches one of: @ABCDEFGHIJKLMNOPQRSTUVWXYZ
3 changes: 3 additions & 0 deletions shared/regex/codeql/regex/OverlyLargeRangeQuery.qll
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ module Make<RegexTreeViewSig TreeImpl> {
or
// the range 0123456789:;<=>? is intentional
result.isRange("0", "?")
or
// [@-Z] is intentional, it's the same as [A-Z@]
result.isRange("@", "Z")
}

/** Gets a char between (and including) `low` and `high`. */
Expand Down

0 comments on commit fb11e4e

Please sign in to comment.