hardened_malloc/test/simple-memory-corruption/eight_byte_overflow_small.c
Daniel Micay acda766e2c fix small allocation canary overwrite test
Overwriting one byte of a canary with 0 has a 1/256 chance of not
triggering the expected failure.
2022-01-03 21:08:14 -05:00

14 lines
188 B
C

#include <stdlib.h>
#include "../test_util.h"
OPTNONE int main(void) {
char *p = malloc(8);
if (!p) {
return 1;
}
*(p + 8 + 7) ^= 1;
free(p);
return 0;
}