mirror of
https://github.com/github/codeql.git
synced 2025-12-21 19:26:31 +01:00
C++: Fill out ArrayFunction model for 'fgets'.
This commit is contained in:
@@ -48,4 +48,16 @@ class GetsFunction extends DataFlowFunction, TaintFunction, ArrayFunction, Alias
|
|||||||
output.isParameterDeref(0) and
|
output.isParameterDeref(0) and
|
||||||
description = "String read by " + this.getName()
|
description = "String read by " + this.getName()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override predicate hasArrayWithVariableSize(int bufParam, int countParam) {
|
||||||
|
not hasGlobalOrStdName("gets") and
|
||||||
|
bufParam = 0 and countParam = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
override predicate hasArrayWithUnknownSize(int bufParam) {
|
||||||
|
hasGlobalOrStdName("gets") and
|
||||||
|
bufParam = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
override predicate hasArrayOutput(int bufParam) { bufParam = 0 }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user