Skip to content

Commit 5bc710b

Browse files
Apply suggestions from code review
Co-authored-by: Felicity Chapman <[email protected]>
1 parent 120fb93 commit 5bc710b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

go/ql/src/Security/CWE-089/StringBreak.qhelp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Code that constructs a quoted string literal containing user-provided data needs
99
this data does not itself contain a quote. Otherwise the embedded data could (accidentally or
1010
intentionally) terminate the string literal early and thereby change the structure of the overall
1111
string, with potentially severe consequences. If, for example, the string is later used as
12-
part an operating-system command or database query, an attacker may be able to craft input data
12+
part of an operating-system command or database query, an attacker may be able to craft input data
1313
that injects a malicious command.
1414
</p>
1515
</overview>
@@ -18,7 +18,7 @@ that injects a malicious command.
1818
<p>
1919
Sanitize the embedded data appropriately to ensure quotes are escaped, or use an API that does
2020
not rely on manually constructing quoted substrings. Make sure to use the appropriate escaping
21-
mechanism, for example double quoting for SQL strings or backslash escaping for shell commands.
21+
mechanism, for example, double quoting for SQL strings or backslash escaping for shell commands.
2222
When using backslash escaping, the backslash character itself must also be escaped.
2323
</p>
2424
</recommendation>
@@ -42,7 +42,7 @@ queries, which avoids the need to explicitly construct a quoted string.
4242
</p>
4343
<sample src="StringBreakGood.go"/>
4444
<p>
45-
In situations where a structured API is not available, make sure to escape quotes before embedding
45+
In situations where a structured API is not available, make sure that you escape quotes before embedding
4646
user-provided data into a quoted string. For example, this is how you can backslash-escape single
4747
quotes using <code>strings.ReplaceAll</code>:
4848
</p>

0 commit comments

Comments
 (0)