mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
23 lines
602 B
Plaintext
23 lines
602 B
Plaintext
/**
|
|
* Provides classes modeling security-relevant aspects of the `unsafe` package.
|
|
*/
|
|
|
|
import go
|
|
|
|
/** Provides models of commonly used functions in the `unsafe` package. */
|
|
module Unsafe {
|
|
private class FunctionModels extends TaintTracking::FunctionModel {
|
|
FunctionInput inp;
|
|
FunctionOutput outp;
|
|
|
|
FunctionModels() {
|
|
hasQualifiedName("unsafe", ["String", "StringData", "Slice", "SliceData"]) and
|
|
(inp.isParameter(0) and outp.isResult())
|
|
}
|
|
|
|
override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) {
|
|
input = inp and output = outp
|
|
}
|
|
}
|
|
}
|