Skip to content

Commit 0756eee

Browse files
Ad example for unsoundness for calloc
1 parent 6f4f80c commit 0756eee

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// PARAM: --set ana.malloc.unique_address_count 1
2+
#include<assert.h>
3+
#include<stdlib.h>
4+
int main() {
5+
int* arr = calloc(5,sizeof(int));
6+
arr[0] = 3;
7+
assert(arr[2] == 0); //UNKNOWN
8+
}

0 commit comments

Comments
 (0)