mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2025-04-19 22:10:19 +02:00
comment explaining XOR for 8 byte overflow test
This commit is contained in:
parent
645414cc9f
commit
c50d06bc6a
1 changed files with 1 additions and 0 deletions
|
@ -8,6 +8,7 @@ OPTNONE int main(void) {
|
|||
return 1;
|
||||
}
|
||||
size_t size = malloc_usable_size(p);
|
||||
// XOR is used to avoid the test having a 1/256 chance to fail
|
||||
*(p + size + 7) ^= 1;
|
||||
free(p);
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue