use calculated size for overflow tests
This greatly reduces how much these tests depend on hard-wired knowledge about the size classes.pull/180/head
parent
acda766e2c
commit
13a1f578cb
|
@ -7,7 +7,8 @@ OPTNONE int main(void) {
|
|||
if (!p) {
|
||||
return 1;
|
||||
}
|
||||
*(p + 256 * 1024 + 7) = 0;
|
||||
size_t size = malloc_usable_size(p);
|
||||
*(p + size + 7) = 0;
|
||||
free(p);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -7,7 +7,8 @@ OPTNONE int main(void) {
|
|||
if (!p) {
|
||||
return 1;
|
||||
}
|
||||
*(p + 8 + 7) ^= 1;
|
||||
size_t size = malloc_usable_size(p);
|
||||
*(p + size + 7) ^= 1;
|
||||
free(p);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue