Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit 5e62b00

Browse files
committed
Fix: Append* does not modify the dst slice argument.
1 parent e7f2fb2 commit 5e62b00

File tree

2 files changed

+197
-229
lines changed
  • ql
    • src/semmle/go/frameworks/stdlib
    • test/library-tests/semmle/go/frameworks/StdlibTaintFlow

2 files changed

+197
-229
lines changed

ql/src/semmle/go/frameworks/stdlib/Reflect.qll

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,11 @@ module Reflect {
1313
FunctionModels() {
1414
// signature: func Append(s Value, x ...Value) Value
1515
hasQualifiedName("reflect", "Append") and
16-
(
17-
inp.isParameter(_) and outp.isResult()
18-
or
19-
inp.isParameter(any(int i | i >= 1)) and outp.isParameter(0)
20-
)
16+
(inp.isParameter(_) and outp.isResult())
2117
or
2218
// signature: func AppendSlice(s Value, t Value) Value
2319
hasQualifiedName("reflect", "AppendSlice") and
24-
(
25-
inp.isParameter(_) and outp.isResult()
26-
or
27-
inp.isParameter(1) and outp.isParameter(0)
28-
)
20+
(inp.isParameter(_) and outp.isResult())
2921
or
3022
// signature: func Copy(dst Value, src Value) int
3123
hasQualifiedName("reflect", "Copy") and

0 commit comments

Comments
 (0)