CPP: Autoformat.

This commit is contained in:
Geoffrey White
2019-11-22 15:02:40 +00:00
parent bbe6a1aa76
commit d6cbc674b6

View File

@@ -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