File tree Expand file tree Collapse file tree
go/ql/lib/semmle/go/frameworks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,8 +44,8 @@ import semmle.go.frameworks.stdlib.TextTabwriter
4444import semmle.go.frameworks.stdlib.TextTemplate
4545import semmle.go.frameworks.stdlib.Unsafe
4646
47- // This is modelled using TaintTracking::FunctionModel because it doesn't have a real type signature ,
48- // and therefore currently has an InvalidType, not a SignatureType, which breaks Models as Data.
47+ // These are modelled using TaintTracking::FunctionModel because they doesn't have real type signatures ,
48+ // and therefore currently have an InvalidType, not a SignatureType, which breaks Models as Data.
4949/**
5050 * A model of the built-in `append` function, which propagates taint from its arguments to its
5151 * result.
@@ -58,6 +58,18 @@ private class AppendFunction extends TaintTracking::FunctionModel {
5858 }
5959}
6060
61+ /**
62+ * A model of the built-in `copy` function, which propagates taint from its second argument
63+ * to its first.
64+ */
65+ private class CopyFunction extends TaintTracking:: FunctionModel {
66+ CopyFunction ( ) { this = Builtin:: copy ( ) }
67+
68+ override predicate hasTaintFlow ( FunctionInput inp , FunctionOutput outp ) {
69+ inp .isParameter ( 1 ) and outp .isParameter ( 0 )
70+ }
71+ }
72+
6173/** Provides a class for modeling functions which convert strings into integers. */
6274module IntegerParser {
6375 /**
You can’t perform that action at this time.
0 commit comments