Skip to content

Commit a8f2fc4

Browse files
author
martin
committed
A simplified example that triggers issue 6230, from @SaswatPadhi
1 parent 432fb2e commit a8f2fc4

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

regression/cbmc/array-bug-6230/main.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include <stdint.h>
2+
#include <stdlib.h>
3+
4+
struct inner {
5+
uint32_t exts[32]; // 32 is the minimum to crash
6+
};
7+
8+
struct outer {
9+
struct inner ctx; // Nesting is necessary
10+
};
11+
12+
int main() {
13+
struct outer *s = malloc(sizeof(struct outer));
14+
if (s != NULL) s->ctx.exts[0] = 0;
15+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
main.c
3+
--malloc-may-fail --malloc-fail-null --pointer-check
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
7+
--
8+
A simplified test case that triggers issue #6230

0 commit comments

Comments
 (0)