Skip to content

Commit 2848ccf

Browse files
committed
fix frontend errors that Go complained about
1 parent 08c0d8e commit 2848ccf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

go/ql/test/query-tests/Security/CWE-078/CommandInjection2.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ import (
99
"regexp"
1010
)
1111

12-
func handler(req *http.Request) {
12+
func handlerExample(req *http.Request) {
1313
imageName := req.URL.Query()["imageName"][0]
14-
outputPath = "/tmp/output.svg"
14+
outputPath := "/tmp/output.svg"
1515
cmd := exec.Command("sh", "-c", fmt.Sprintf("imagetool %s > %s", imageName, outputPath)) // NOT OK - correctly flagged
1616
cmd.Run()
1717
// ...
1818
}
1919

20-
func handler2(req *http.Request) {
20+
func handlerExample2(req *http.Request) {
2121
imageName := req.URL.Query()["imageName"][0]
2222
outputPath := "/tmp/output.svg"
2323

@@ -37,7 +37,7 @@ func handler2(req *http.Request) {
3737
cmd.Run()
3838
}
3939

40-
func handler3(req *http.Request) {
40+
func handlerExample3(req *http.Request) {
4141
imageName := req.URL.Query()["imageName"][0]
4242
outputPath := "/tmp/output.svg"
4343

0 commit comments

Comments
 (0)