mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2025-07-01 17:36:47 -04:00

Overwriting one byte of a canary with 0 has a 1/256 chance of not triggering the expected failure.
13 lines
188 B
C
13 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;
|
|
}
|