mirror of
https://github.com/github/codeql.git
synced 2026-01-27 13:23:00 +01:00
This PR separates the core cpp packs into `codeql/cpp-queries` and `codeql/cpp-all`. There are very few lines of code changed. Almost all changes are moving files around.
21 lines
619 B
Plaintext
21 lines
619 B
Plaintext
import semmle.code.cpp.models.interfaces.Alias
|
|
import semmle.code.cpp.models.interfaces.FlowSource
|
|
|
|
private class Fread extends AliasFunction, RemoteFlowSourceFunction {
|
|
Fread() { this.hasGlobalOrStdOrBslName("fread") }
|
|
|
|
override predicate parameterNeverEscapes(int n) {
|
|
n = 0 or
|
|
n = 3
|
|
}
|
|
|
|
override predicate parameterEscapesOnlyViaReturn(int n) { none() }
|
|
|
|
override predicate parameterIsAlwaysReturned(int n) { none() }
|
|
|
|
override predicate hasRemoteFlowSource(FunctionOutput output, string description) {
|
|
output.isParameterDeref(0) and
|
|
description = "String read by " + this.getName()
|
|
}
|
|
}
|