Skip to content

Commit f055a78

Browse files
committed
Copy "Parameter" tests to ExternalValueFlow
1 parent 08ea30e commit f055a78

File tree

5 files changed

+8
-0
lines changed

5 files changed

+8
-0
lines changed

go/ql/test/library-tests/semmle/go/dataflow/ExternalValueFlow/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/ExternalValueFlow/sinks.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,4 @@ invalidModelRow
5050
| test.go:206:10:206:26 | call to min | qltest |
5151
| test.go:207:10:207:26 | call to min | qltest |
5252
| test.go:210:22:210:25 | temp | qltest |
53+
| test.go:214:10:214:12 | src | qltest |

go/ql/test/library-tests/semmle/go/dataflow/ExternalValueFlow/srcs.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ invalidModelRow
2222
| test.go:187:24:187:31 | call to Src1 | qltest |
2323
| test.go:191:24:191:31 | call to Src1 | qltest |
2424
| test.go:209:10:209:28 | selection of SourceVariable | qltest |
25+
| test.go:213:15:213:17 | definition of src | qltest |

go/ql/test/library-tests/semmle/go/dataflow/ExternalValueFlow/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/ExternalValueFlow/test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,10 @@ func simpleflow() {
210210
test.SinkVariable = temp // $ hasValueFlow="temp"
211211
}
212212

213+
func srcParam(src string, b test.B) {
214+
b.Sink1(src) // $ hasValueFlow="src"
215+
}
216+
213217
type mapstringstringtype map[string]string
214218
type arraytype []interface{}
215219
type channeltype chan interface{}

0 commit comments

Comments
 (0)