File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
cpp/ql/src/Security/CWE/CWE-131 Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -21,16 +21,12 @@ import semmle.code.cpp.models.interfaces.ArrayFunction
2121class 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
2927predicate 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
You can’t perform that action at this time.
0 commit comments