Skip to content

Commit d6cbc67

Browse files
committed
CPP: Autoformat.
1 parent bbe6a1a commit d6cbc67

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

cpp/ql/src/Security/CWE/CWE-131/NoSpaceForZeroTerminator.ql

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,12 @@ import semmle.code.cpp.models.interfaces.ArrayFunction
2121
class MallocCall extends FunctionCall {
2222
MallocCall() { this.getTarget().hasGlobalOrStdName("malloc") }
2323

24-
Expr getAllocatedSize() {
25-
result = this.getArgument(0)
26-
}
24+
Expr getAllocatedSize() { result = this.getArgument(0) }
2725
}
2826

2927
predicate terminationProblem(MallocCall malloc, string msg) {
3028
// malloc(strlen(...))
31-
exists(StrlenCall strlen |
32-
DataFlow::localExprFlow(strlen, malloc.getAllocatedSize())
33-
) and
29+
exists(StrlenCall strlen | DataFlow::localExprFlow(strlen, malloc.getAllocatedSize())) and
3430
// flows into a null-terminated string function
3531
exists(ArrayFunction af, FunctionCall fc, int arg |
3632
DataFlow::localExprFlow(malloc, fc.getArgument(arg)) and

0 commit comments

Comments
 (0)