Skip to content

Commit e2a4c2a

Browse files
committed
move the code samples for the Go command-injection queries to an examples/ folder
1 parent 4617c05 commit e2a4c2a

File tree

5 files changed

+3
-3
lines changed

5 files changed

+3
-3
lines changed

go/ql/src/Security/CWE-078/CommandInjection.qhelp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ using it.
2727
In the following example, assume the function <code>handler</code> is an HTTP request handler in a
2828
web application, whose parameter <code>req</code> contains the request object:
2929
</p>
30-
<sample src="CommandInjection.go"/>
30+
<sample src="examples/CommandInjection.go"/>
3131
<p>
3232
The handler extracts the name of a system command from the request object, and then runs it without
3333
any further checks, which can cause a command-injection vulnerability.

go/ql/src/Security/CWE-078/StoredCommand.qhelp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ using it.
2828
In the following example, the function <code>run</code> runs a command directly from the result of a
2929
query:
3030
</p>
31-
<sample src="StoredCommand.go"/>
31+
<sample src="examples/StoredCommand.go"/>
3232
<p>
3333
The function extracts the name of a system command from the database query, and then runs it without
3434
any further checks, which can cause a command-injection vulnerability. A possible solution is to
3535
ensure that commands are checked against a whitelist:
3636
</p>
37-
<sample src="StoredCommandGood.go"/>
37+
<sample src="examples/StoredCommandGood.go"/>
3838
</example>
3939

4040
<references>

0 commit comments

Comments
 (0)