Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit de8d84d

Browse files
committed
C++: Clearer comments in NoSpaceForZeroTerminator.ql.
1 parent 2f290bd commit de8d84d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ import semmle.code.cpp.models.interfaces.Allocation
2222
predicate terminationProblem(AllocationExpr malloc, string msg) {
2323
// malloc(strlen(...))
2424
exists(StrlenCall strlen | DataFlow::localExprFlow(strlen, malloc.getSizeExpr())) and
25-
// flows into a null-terminated string function
25+
// flows to a call that implies this is a null-terminated string
2626
exists(ArrayFunction af, FunctionCall fc, int arg |
2727
DataFlow::localExprFlow(malloc, fc.getArgument(arg)) and
2828
fc.getTarget() = af and
2929
(
30-
// null terminated string
30+
// flows into null terminated string argument
3131
af.hasArrayWithNullTerminator(arg)
3232
or
33-
// likely a null terminated string (such as `strcpy`, `strcat`)
33+
// flows into likely null terminated string argument (such as `strcpy`, `strcat`)
3434
af.hasArrayWithUnknownSize(arg)
3535
)
3636
) and

0 commit comments

Comments
 (0)