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 {
437
437
int sizeArg ;
438
438
439
439
HeuristicAllocationFunctionByName ( ) {
440
- Function .super .getName ( ) .matches ( "%alloc%" ) and
440
+ Function .super .getName ( ) .matches ( [ "%alloc%" , "%Alloc%" ] ) and
441
441
Function .super .getUnspecifiedType ( ) instanceof PointerType and
442
442
sizeArg = unique( | | getAnUnsignedParameter ( this ) )
443
443
}
Original file line number Diff line number Diff line change @@ -246,6 +246,6 @@ void test_flow_through_setter(unsigned size) {
246
246
void * my_alloc (unsigned size);
247
247
248
248
void foo (unsigned size) {
249
- int * p = (int *)my_alloc (size); // BAD [NOT DETECTED]
249
+ int * p = (int *)my_alloc (size); // BAD
250
250
memset (p, 0 , size + 1 );
251
251
}
You can’t perform that action at this time.
0 commit comments