You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since we want to add a new sink, we need to add a tuple to the ``sinkModel`` extensible predicate.
95
95
The first five values identify the callable (in this case a method) to be modeled as a sink.
@@ -98,7 +98,7 @@ The first five values identify the callable (in this case a method) to be modele
98
98
- The second value ``DB`` is the name of the type that the method is associated with.
99
99
- The third value ``False`` is a flag that indicates whether or not the sink also applies to all overrides of the method.
100
100
- The fourth value ``Prepare`` is the method name. Constructors are named after the class.
101
-
- The fifth value ``(string)`` is the method input type signature. This value is often excluded and is simply set to an empty string since Go does not allow for a given type to have multiple methods with the same type.
101
+
- The fifth value ``""`` is the method input type signature. For Go it should always be an empty string. It is needed for other languages where multiple functions or methods may have the same name and they need to be distinguished by the number and types of the arguments.
102
102
103
103
The sixth value should be left empty and is out of scope for this documentation.
104
104
The remaining values are used to define the ``access path``, the ``kind``, and the ``provenance`` (origin) of the sink.
@@ -228,7 +228,7 @@ We need to add a tuple to the ``summaryModel``\(namespace, type, subtypes, name,
Since we are adding flow through a method, we need to add tuples to the ``summaryModel`` extensible predicate.
234
234
Each tuple defines flow from one argument to the return value.
@@ -241,12 +241,12 @@ These are the same for both of the rows above as we are adding two summaries for
241
241
- The second value ``URL`` is the receiver type.
242
242
- The third value ``True`` is a flag that indicates whether or not the summary also applies to all overrides of the method.
243
243
- The fourth value ``Hostname`` is the method name.
244
-
- The fifth value ``()`` is the method input type signature.
244
+
- The fifth value ``""`` is left blank, since specifying the signature is optional and Go does not allow multiple signature overloads for the same function.
245
245
246
246
The sixth value should be left empty and is out of scope for this documentation.
247
247
The remaining values are used to define the ``access path``, the ``kind``, and the ``provenance`` (origin) of the summary.
248
248
249
-
- The seventh value is the access path to the input (where data flows from). ``Argument[this]`` is the access path to the qualifier (``u`` in the example).
249
+
- The seventh value is the access path to the input (where data flows from). ``Argument[receiver]`` is the access path to the receiver (``u`` in the example).
250
250
- The eighth value ``ReturnValue`` is the access path to the output (where data flows to), in this case ``ReturnValue``, which means that the input flows to the return value.
251
251
- The ninth value ``taint`` is the kind of the flow. ``taint`` means that taint is propagated through the call.
252
252
- The tenth value ``manual`` is the provenance of the summary, which is used to identify the origin of the summary.
0 commit comments