File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
go/ql/lib/semmle/go/frameworks Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,30 @@ import semmle.go.frameworks.stdlib.TextTabwriter
44
44
import semmle.go.frameworks.stdlib.TextTemplate
45
45
import semmle.go.frameworks.stdlib.Unsafe
46
46
47
+ /**
48
+ * A model of the built-in `append` function, which propagates taint from its arguments to its
49
+ * result.
50
+ */
51
+ private class AppendFunction extends TaintTracking:: FunctionModel {
52
+ AppendFunction ( ) { this = Builtin:: append ( ) }
53
+
54
+ override predicate hasTaintFlow ( FunctionInput inp , FunctionOutput outp ) {
55
+ inp .isParameter ( _) and outp .isResult ( )
56
+ }
57
+ }
58
+
59
+ /**
60
+ * A model of the built-in `copy` function, which propagates taint from its second argument
61
+ * to its first.
62
+ */
63
+ private class CopyFunction extends TaintTracking:: FunctionModel {
64
+ CopyFunction ( ) { this = Builtin:: copy ( ) }
65
+
66
+ override predicate hasTaintFlow ( FunctionInput inp , FunctionOutput outp ) {
67
+ inp .isParameter ( 1 ) and outp .isParameter ( 0 )
68
+ }
69
+ }
70
+
47
71
/** Provides a class for modeling functions which convert strings into integers. */
48
72
module IntegerParser {
49
73
/**
You can’t perform that action at this time.
0 commit comments