mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2024-06-29 08:02:11 +00:00
![Daniel Micay](/assets/img/avatar_default.png)
Overwriting one byte of a canary with 0 has a 1/256 chance of not triggering the expected failure.
14 lines
188 B
C
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;
|
|
}
|