File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
lib/semmle/code/cpp/models/implementations
test/experimental/query-tests/Security/CWE/CWE-119 Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -437,7 +437,7 @@ private module HeuristicAllocation {
437437 int sizeArg ;
438438
439439 HeuristicAllocationFunctionByName ( ) {
440- Function .super .getName ( ) .matches ( "%alloc%" ) and
440+ Function .super .getName ( ) .matches ( [ "%alloc%" , "%Alloc%" ] ) and
441441 Function .super .getUnspecifiedType ( ) instanceof PointerType and
442442 sizeArg = unique( | | getAnUnsignedParameter ( this ) )
443443 }
Original file line number Diff line number Diff line change @@ -246,6 +246,6 @@ void test_flow_through_setter(unsigned size) {
246246void * my_alloc (unsigned size);
247247
248248void foo (unsigned size) {
249- int * p = (int *)my_alloc (size); // BAD [NOT DETECTED]
249+ int * p = (int *)my_alloc (size); // BAD
250250 memset (p, 0 , size + 1 );
251251}
You can’t perform that action at this time.
0 commit comments