This repository was archived by the owner on Jan 5, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
ql/src/semmle/go/frameworks/stdlib Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,34 @@ import go
6
6
7
7
/** Provides models of commonly used functions in the `encoding/asn1` package. */
8
8
module EncodingAsn1 {
9
+ /** The `Marshal` or `MarshalWithParams` function in the `encoding/asn1` package. */
10
+ private class MarshalFunction extends MarshalingFunction:: Range {
11
+ MarshalFunction ( ) {
12
+ hasQualifiedName ( "encoding/asn1" , "Marshal" ) or
13
+ hasQualifiedName ( "encoding/asn1" , "MarshalWithParams" )
14
+ }
15
+
16
+ override FunctionInput getAnInput ( ) { result .isParameter ( 0 ) }
17
+
18
+ override FunctionOutput getOutput ( ) { result .isResult ( 0 ) }
19
+
20
+ override string getFormat ( ) { result = "ASN1" }
21
+ }
22
+
23
+ /** The `Unmarshal` or `UnmarshalWithParams` function in the `encoding/asn1` package. */
24
+ private class UnmarshalFunction extends UnmarshalingFunction:: Range {
25
+ UnmarshalFunction ( ) {
26
+ hasQualifiedName ( "encoding/asn1" , "Unmarshal" ) or
27
+ hasQualifiedName ( "encoding/asn1" , "UnmarshalWithParams" )
28
+ }
29
+
30
+ override FunctionInput getAnInput ( ) { result .isParameter ( 0 ) }
31
+
32
+ override FunctionOutput getOutput ( ) { result .isParameter ( 1 ) }
33
+
34
+ override string getFormat ( ) { result = "ASN1" }
35
+ }
36
+
9
37
private class FunctionModels extends TaintTracking:: FunctionModel {
10
38
FunctionInput inp ;
11
39
FunctionOutput outp ;
You can’t perform that action at this time.
0 commit comments