hardened_malloc/test/simple-memory-corruption/eight_byte_overflow_small.c

14 lines
187 B
C
Raw Normal View History

2018-09-04 13:06:23 +00:00
#include <stdlib.h>
#include "../test_util.h"
OPTNONE int main(void) {
2018-09-04 13:06:23 +00:00
char *p = malloc(8);
if (!p) {
return 1;
}
*(p + 8 + 7) = 0;
free(p);
return 0;
}