Skip to content

Commit

Permalink
Add example for unsoundness for calloc
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-schwarz committed Jul 24, 2022
1 parent 6f4f80c commit a992328
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/regression/11-heap/12-calloc.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// PARAM: --set ana.malloc.unique_address_count 1
#include<assert.h>
#include<stdlib.h>
int main() {
int* arr = calloc(5,sizeof(int));
arr[0] = 3;
assert(arr[2] == 0); //UNKNOWN
}

0 comments on commit a992328

Please sign in to comment.