comment explaining XOR for 8 byte overflow test

This commit is contained in:
Daniel Micay 2022-01-03 21:23:14 -05:00
parent 645414cc9f
commit c50d06bc6a
1 changed files with 1 additions and 0 deletions

View File

@ -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;