Copy "Parameter" tests to ExternalValueFlow

This commit is contained in:
Owen Mansel-Chan
2025-01-22 22:43:55 +00:00
parent 08ea30ea8d
commit f055a78abf
5 changed files with 8 additions and 0 deletions

View File

@@ -37,6 +37,7 @@ extensions:
data:
- ["github.com/nonexistent/test", "", False, "SourceVariable", "", "", "", "qltest", "manual"]
- ["github.com/nonexistent/test", "A", False, "Src1", "", "", "ReturnValue", "qltest", "manual"]
- ["semmle.go.Packages", "", True, "srcParam", "", "", "Parameter[0]", "qltest", "manual"]
- addsTo:
pack: codeql/go-all
extensible: sinkModel

View File

@@ -50,3 +50,4 @@ invalidModelRow
| test.go:206:10:206:26 | call to min | qltest |
| test.go:207:10:207:26 | call to min | qltest |
| test.go:210:22:210:25 | temp | qltest |
| test.go:214:10:214:12 | src | qltest |

View File

@@ -22,3 +22,4 @@ invalidModelRow
| test.go:187:24:187:31 | call to Src1 | qltest |
| test.go:191:24:191:31 | call to Src1 | qltest |
| test.go:209:10:209:28 | selection of SourceVariable | qltest |
| test.go:213:15:213:17 | definition of src | qltest |

View File

@@ -10,3 +10,4 @@ extensions:
- ["github.com/nonexistent/test", "A", False, "SrcArg", "", "", "Argument[0]", "qltest-arg", "manual"]
- ["github.com/nonexistent/test", "A", False, "Src3", "", "", "ReturnValue[0]", "qltest", "manual"]
- ["github.com/nonexistent/test", "A", True, "Src3", "", "", "ReturnValue[1]", "qltest-w-subtypes", "manual"]
- ["semmle.go.Packages", "", True, "srcParam", "", "", "Parameter[0]", "qltest", "manual"]

View File

@@ -210,6 +210,10 @@ func simpleflow() {
test.SinkVariable = temp // $ hasValueFlow="temp"
}
func srcParam(src string, b test.B) {
b.Sink1(src) // $ hasValueFlow="src"
}
type mapstringstringtype map[string]string
type arraytype []interface{}
type channeltype chan interface{}