hardened_malloc/test/simple-memory-corruption/write_after_free_large_reuse.c
2018-10-08 17:41:06 -04:00

15 lines
250 B
C

#include <stdlib.h>
#include <string.h>
__attribute__((optimize(0)))
int main(void) {
char *p = malloc(128 * 1024);
if (!p) {
return 1;
}
free(p);
char *q = malloc(128 * 1024);
p[64 * 1024 + 1] = 'a';
return 0;
}