diff --git a/test/simple-memory-corruption/Makefile b/test/simple-memory-corruption/Makefile index e638996..62d6653 100644 --- a/test/simple-memory-corruption/Makefile +++ b/test/simple-memory-corruption/Makefile @@ -12,3 +12,6 @@ all: \ invalid_free_protected \ invalid_free_unprotected \ invalid_free_small_region \ + uninitialized_free \ + uninitialized_realloc \ + uninitialized_malloc_usable_size \ diff --git a/test/simple-memory-corruption/uninitialized_free.c b/test/simple-memory-corruption/uninitialized_free.c new file mode 100644 index 0000000..0028be9 --- /dev/null +++ b/test/simple-memory-corruption/uninitialized_free.c @@ -0,0 +1,7 @@ +#include + +__attribute__((optimize(0))) +int main(void) { + free((void *)1); + return 0; +} diff --git a/test/simple-memory-corruption/uninitialized_malloc_usable_size.c b/test/simple-memory-corruption/uninitialized_malloc_usable_size.c new file mode 100644 index 0000000..3b2924f --- /dev/null +++ b/test/simple-memory-corruption/uninitialized_malloc_usable_size.c @@ -0,0 +1,7 @@ +#include + +__attribute__((optimize(0))) +int main(void) { + malloc_usable_size((void *)1); + return 0; +} diff --git a/test/simple-memory-corruption/uninitialized_realloc.c b/test/simple-memory-corruption/uninitialized_realloc.c new file mode 100644 index 0000000..e0dc09a --- /dev/null +++ b/test/simple-memory-corruption/uninitialized_realloc.c @@ -0,0 +1,10 @@ +#include + +__attribute__((optimize(0))) +int main(void) { + void *p = realloc((void *)1, 16); + if (!p) { + return 1; + } + return 0; +}