mirror of
https://github.com/github/codeql.git
synced 2026-05-02 04:05:14 +02:00
C++: Add a testcase that needs heuristic allocation.
This commit is contained in:
@@ -243,3 +243,9 @@ void test_flow_through_setter(unsigned size) {
|
||||
memset(str.string, 0, size + 1); // BAD
|
||||
}
|
||||
|
||||
void* my_alloc(unsigned size);
|
||||
|
||||
void foo(unsigned size) {
|
||||
int* p = (int*)my_alloc(size); // BAD [NOT DETECTED]
|
||||
memset(p, 0, size + 1);
|
||||
}
|
||||
Reference in New Issue
Block a user