Skip to content

Commit

Permalink
use-after-free-test
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Tietz committed Jan 25, 2024
1 parent 258ed14 commit c7b4256
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
7 changes: 0 additions & 7 deletions tests/practical/use-after-free.c

This file was deleted.

11 changes: 11 additions & 0 deletions tests/regression/79-assembly/03-asm-use-after-free.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//PARAM: --set ana.activated[+] useAfterFree --disable asm_is_nop
#include <stdlib.h>

int main(void) {
int *x = malloc(16);
free(x);
// write
asm ("nop" : "=x" (*x)); // WARN
// read
asm ("nop" : : "x" (*x)); // WARN
}

0 comments on commit c7b4256

Please sign in to comment.