Skip to content

Commit 4ec30b2

Browse files
authored
Merge pull request #267 from github/erik-krogh/redosUnicode
use toUnicode in ReDoSUtil.qll
2 parents ffd80fc + ff27a0c commit 4ec30b2

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

ql/src/codeql_ruby/regexp/ReDoSUtil.qll

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -433,12 +433,7 @@ private module CharacterClasses {
433433
char = "0123456789".charAt(_)
434434
or
435435
clazz = "s" and
436-
(
437-
char = [" ", "\t", "\r", "\n"]
438-
or
439-
char = getARelevantChar() and
440-
char.regexpMatch("\\u000b|\\u000c") // \v|\f (vertical tab | form feed)
441-
)
436+
char = [" ", "\t", "\r", "\n", 11.toUnicode(), 12.toUnicode()] // 11.toUnicode() = \v, 12.toUnicode() = \f'
442437
or
443438
clazz = "w" and
444439
char = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_".charAt(_)

0 commit comments

Comments
 (0)