diff --git a/test/simple-memory-corruption/Makefile b/test/simple-memory-corruption/Makefile index 62d6653..ea267c1 100644 --- a/test/simple-memory-corruption/Makefile +++ b/test/simple-memory-corruption/Makefile @@ -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 \ diff --git a/test/simple-memory-corruption/invalid_free_small_region_far.c b/test/simple-memory-corruption/invalid_free_small_region_far.c new file mode 100644 index 0000000..4a7ed29 --- /dev/null +++ b/test/simple-memory-corruption/invalid_free_small_region_far.c @@ -0,0 +1,12 @@ +#include + +__attribute__((optimize(0))) +int main(void) { + char *p = malloc(16); + if (!p) { + return 1; + } + char *q = p + 1024 * 1024 * 1024; + free(q); + return 0; +}