mirror of
https://github.com/github/codeql.git
synced 2026-04-30 03:05:15 +02:00
CPP: Autoformat.
This commit is contained in:
@@ -21,16 +21,12 @@ import semmle.code.cpp.models.interfaces.ArrayFunction
|
||||
class MallocCall extends FunctionCall {
|
||||
MallocCall() { this.getTarget().hasGlobalOrStdName("malloc") }
|
||||
|
||||
Expr getAllocatedSize() {
|
||||
result = this.getArgument(0)
|
||||
}
|
||||
Expr getAllocatedSize() { result = this.getArgument(0) }
|
||||
}
|
||||
|
||||
predicate terminationProblem(MallocCall malloc, string msg) {
|
||||
// malloc(strlen(...))
|
||||
exists(StrlenCall strlen |
|
||||
DataFlow::localExprFlow(strlen, malloc.getAllocatedSize())
|
||||
) and
|
||||
exists(StrlenCall strlen | DataFlow::localExprFlow(strlen, malloc.getAllocatedSize())) and
|
||||
// flows into a null-terminated string function
|
||||
exists(ArrayFunction af, FunctionCall fc, int arg |
|
||||
DataFlow::localExprFlow(malloc, fc.getArgument(arg)) and
|
||||
|
||||
Reference in New Issue
Block a user