mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2024-12-30 01:46:16 -05:00
add another test for invalid small region frees
This commit is contained in:
parent
fe85116891
commit
bde8c3c29b
@ -12,6 +12,7 @@ all: \
|
||||
invalid_free_protected \
|
||||
invalid_free_unprotected \
|
||||
invalid_free_small_region \
|
||||
invalid_free_small_region_far \
|
||||
uninitialized_free \
|
||||
uninitialized_realloc \
|
||||
uninitialized_malloc_usable_size \
|
||||
|
@ -0,0 +1,12 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
__attribute__((optimize(0)))
|
||||
int main(void) {
|
||||
char *p = malloc(16);
|
||||
if (!p) {
|
||||
return 1;
|
||||
}
|
||||
char *q = p + 1024 * 1024 * 1024;
|
||||
free(q);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user