Skip to content

Commit 710b309

Browse files
committed
apply suggestions from doc review
1 parent 10bf17c commit 710b309

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

java/ql/src/Security/CWE/CWE-730/PolynomialReDoS.qhelp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Pattern.compile("^\\s+|\\s+$").matcher(text).replaceAll("") // BAD</sample>
105105
<p>
106106
Sometimes it is unclear how a regular expression can be rewritten to
107107
avoid the problem. In such cases, it often suffices to limit the
108-
length of the input string. For instance, the following complicated
108+
length of the input string. For instance, the following
109109
regular expression is used to match numbers, and on some non-number
110110
inputs it can have quadratic time complexity:
111111
</p>
@@ -115,7 +115,7 @@ Pattern.matches("^(\\+|-)?(\\d+|(\\d*\\.\\d*))?(E|e)?([-+])?(\\d+)?$", str); </s
115115

116116
<p>
117117
It is not immediately obvious how to rewrite this regular expression
118-
to avoid the problem. However, it might be fine to limit the length
118+
to avoid the problem. However, you can mitigate performance issues by limiting the length
119119
to 1000 characters, which will always finish in a reasonable amount
120120
of time.
121121
</p>

javascript/ql/src/Performance/PolynomialReDoS.qhelp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ text.replace(/^\s+|\s+$/g, ''); // BAD</sample>
105105
<p>
106106
Sometimes it is unclear how a regular expression can be rewritten to
107107
avoid the problem. In such cases, it often suffices to limit the
108-
length of the input string. For instance, the following complicated
108+
length of the input string. For instance, the following
109109
regular expression is used to match numbers, and on some non-number
110110
inputs it can have quadratic time complexity:
111111
</p>
@@ -115,7 +115,7 @@ text.replace(/^\s+|\s+$/g, ''); // BAD</sample>
115115

116116
<p>
117117
It is not immediately obvious how to rewrite this regular expression
118-
to avoid the problem. However, it might be fine to limit the length
118+
to avoid the problem. However, you can mitigate performance issues by limiting the length
119119
to 1000 characters, which will always finish in a reasonable amount
120120
of time.
121121
</p>
@@ -124,6 +124,7 @@ text.replace(/^\s+|\s+$/g, ''); // BAD</sample>
124124
if (str.length &gt; 1000) {
125125
throw new Error("Input too long");
126126
}
127+
127128
/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/.test(str)</sample>
128129
</example>
129130

python/ql/src/Security/CWE-730/PolynomialReDoS.qhelp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ re.sub(r"^\s+|\s+$", "", text) # BAD</sample>
105105
<p>
106106
Sometimes it is unclear how a regular expression can be rewritten to
107107
avoid the problem. In such cases, it often suffices to limit the
108-
length of the input string. For instance, the following complicated
108+
length of the input string. For instance, the following
109109
regular expression is used to match numbers, and on some non-number
110110
inputs it can have quadratic time complexity:
111111
</p>
@@ -115,7 +115,7 @@ match = re.search(r'^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$', str) </sampl
115115

116116
<p>
117117
It is not immediately obvious how to rewrite this regular expression
118-
to avoid the problem. However, it might be fine to limit the length
118+
to avoid the problem. However, you can mitigate performance issues by limiting the length
119119
to 1000 characters, which will always finish in a reasonable amount
120120
of time.
121121
</p>

ruby/ql/src/queries/security/cwe-1333/PolynomialReDoS.qhelp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ text.gsub!(/^\s+|\s+$/, '') # BAD</sample>
110110
<p>
111111
Sometimes it is unclear how a regular expression can be rewritten to
112112
avoid the problem. In such cases, it often suffices to limit the
113-
length of the input string. For instance, the following complicated
113+
length of the input string. For instance, the following
114114
regular expression is used to match numbers, and on some non-number
115115
inputs it can have quadratic time complexity:
116116
</p>
@@ -120,7 +120,7 @@ is_matching = /^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/.match?(str)</sampl
120120

121121
<p>
122122
It is not immediately obvious how to rewrite this regular expression
123-
to avoid the problem. However, it might be fine to limit the length
123+
to avoid the problem. However, you can mitigate performance issues by limiting the length
124124
to 1000 characters, which will always finish in a reasonable amount
125125
of time.
126126
</p>

0 commit comments

Comments
 (0)