From acda766e2ccdeedb7a4a634d84089a1ca1f73b8c Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Mon, 3 Jan 2022 21:07:24 -0500 Subject: [PATCH] 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. --- test/simple-memory-corruption/eight_byte_overflow_small.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/simple-memory-corruption/eight_byte_overflow_small.c b/test/simple-memory-corruption/eight_byte_overflow_small.c index 0ac796b..bd2666d 100644 --- a/test/simple-memory-corruption/eight_byte_overflow_small.c +++ b/test/simple-memory-corruption/eight_byte_overflow_small.c @@ -7,7 +7,7 @@ OPTNONE int main(void) { if (!p) { return 1; } - *(p + 8 + 7) = 0; + *(p + 8 + 7) ^= 1; free(p); return 0; }