File tree Expand file tree Collapse file tree
cpp/ql/src/Security/CWE/CWE-131 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,15 +22,15 @@ import semmle.code.cpp.models.interfaces.Allocation
2222predicate 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
You can’t perform that action at this time.
0 commit comments