mirror of
https://github.com/github/codeql.git
synced 2025-12-24 20:56:33 +01:00
12 lines
269 B
C++
12 lines
269 B
C++
#define RECORD_SIZE 30 //incorrect or outdated size for record
|
|
typedef struct {
|
|
char name[30];
|
|
int status;
|
|
} Record;
|
|
|
|
void f() {
|
|
Record* p = malloc(RECORD_SIZE * 4); //wrong: not a multiple of the size of Record
|
|
p[3].status = 1; //will most likely segfault
|
|
...
|
|
}
|