Skip to content

Commit 8e481bd

Browse files
committed
Add failing tests for "Parameter" in MaD
1 parent 4bd4937 commit 8e481bd

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

go/ql/test/library-tests/semmle/go/dataflow/ExternalTaintFlow/completetest.ext.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ extensions:
3737
data:
3838
- ["github.com/nonexistent/test", "", False, "SourceVariable", "", "", "", "qltest", "manual"]
3939
- ["github.com/nonexistent/test", "A", False, "Src1", "", "", "ReturnValue", "qltest", "manual"]
40+
- ["semmle.go.Packages", "", True, "srcParam", "", "", "Parameter[0]", "qltest", "manual"]
4041
- addsTo:
4142
pack: codeql/go-all
4243
extensible: sinkModel

go/ql/test/library-tests/semmle/go/dataflow/ExternalTaintFlow/sinks.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,4 @@ invalidModelRow
4444
| test.go:199:23:199:26 | arg2 | qltest |
4545
| test.go:199:29:199:32 | arg3 | qltest |
4646
| test.go:202:22:202:25 | temp | qltest |
47+
| test.go:206:10:206:12 | src | qltest |

go/ql/test/library-tests/semmle/go/dataflow/ExternalTaintFlow/srcs.ext.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ extensions:
1010
- ["github.com/nonexistent/test", "A", False, "SrcArg", "", "", "Argument[0]", "qltest-arg", "manual"]
1111
- ["github.com/nonexistent/test", "A", False, "Src3", "", "", "ReturnValue[0]", "qltest", "manual"]
1212
- ["github.com/nonexistent/test", "A", True, "Src3", "", "", "ReturnValue[1]", "qltest-w-subtypes", "manual"]
13+
- ["semmle.go.Packages", "", True, "srcParam", "", "", "Parameter[0]", "qltest", "manual"]

go/ql/test/library-tests/semmle/go/dataflow/ExternalTaintFlow/test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,10 @@ func simpleflow() {
202202
test.SinkVariable = temp // $ hasTaintFlow="temp"
203203
}
204204

205+
func srcParam(src string, b test.B) {
206+
b.Sink1(src) // $ MISSING: hasTaintFlow="src"
207+
}
208+
205209
type mapstringstringtype map[string]string
206210
type arraytype []interface{}
207211
type channeltype chan interface{}

0 commit comments

Comments
 (0)