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

View File

@ -8,6 +8,7 @@ OPTNONE int main(void) {
return 1; return 1;
} }
size_t size = malloc_usable_size(p); 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; *(p + size + 7) ^= 1;
free(p); free(p);
return 0; return 0;