File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
swift/ql/src/queries/Security/CWE-1333 Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 2
2
<qhelp >
3
3
<include src =" ReDoSIntroduction.inc.qhelp" />
4
4
<example >
5
- <p >Consider this regular expression:</p >
5
+ <p >Consider the following regular expression:</p >
6
6
<sample language =" swift" >
7
7
/^_(__|.)+_$/</sample >
8
8
<p >
9
9
Its sub-expression <code >"(__|.)+"</code > can match the string
10
10
<code >"__"</code > either by the first alternative <code >"__"</code > to the
11
11
left of the <code >"|"</code > operator, or by two repetitions of the second
12
- alternative <code >"."</code > to the right. Thus , a string consisting of an
12
+ alternative <code >"."</code > to the right. Therefore , a string consisting of an
13
13
odd number of underscores followed by some other character will cause the
14
14
regular expression engine to run for an exponential amount of time before
15
15
rejecting the input.
Original file line number Diff line number Diff line change 31
31
<p >
32
32
Modify the regular expression to remove the ambiguity, or ensure that the
33
33
strings matched with the regular expression are short enough that the
34
- time- complexity does not matter.
34
+ time complexity does not matter.
35
35
</p >
36
36
</recommendation >
37
37
</qhelp >
You can’t perform that action at this time.
0 commit comments