mirror of
https://github.com/github/codeql.git
synced 2026-01-29 22:32:58 +01:00
Extend MarshalingFunction and UnmarshalingFunction with encoding/asn1
This commit is contained in:
@@ -6,6 +6,34 @@ import go
|
||||
|
||||
/** Provides models of commonly used functions in the `encoding/asn1` package. */
|
||||
module EncodingAsn1 {
|
||||
/** The `Marshal` or `MarshalWithParams` function in the `encoding/asn1` package. */
|
||||
private class MarshalFunction extends MarshalingFunction::Range {
|
||||
MarshalFunction() {
|
||||
hasQualifiedName("encoding/asn1", "Marshal") or
|
||||
hasQualifiedName("encoding/asn1", "MarshalWithParams")
|
||||
}
|
||||
|
||||
override FunctionInput getAnInput() { result.isParameter(0) }
|
||||
|
||||
override FunctionOutput getOutput() { result.isResult(0) }
|
||||
|
||||
override string getFormat() { result = "ASN1" }
|
||||
}
|
||||
|
||||
/** The `Unmarshal` or `UnmarshalWithParams` function in the `encoding/asn1` package. */
|
||||
private class UnmarshalFunction extends UnmarshalingFunction::Range {
|
||||
UnmarshalFunction() {
|
||||
hasQualifiedName("encoding/asn1", "Unmarshal") or
|
||||
hasQualifiedName("encoding/asn1", "UnmarshalWithParams")
|
||||
}
|
||||
|
||||
override FunctionInput getAnInput() { result.isParameter(0) }
|
||||
|
||||
override FunctionOutput getOutput() { result.isParameter(1) }
|
||||
|
||||
override string getFormat() { result = "ASN1" }
|
||||
}
|
||||
|
||||
private class FunctionModels extends TaintTracking::FunctionModel {
|
||||
FunctionInput inp;
|
||||
FunctionOutput outp;
|
||||
|
||||
Reference in New Issue
Block a user