Skip to content

Commit 1e1e383

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

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include <stdint.h>
2+
#include <stdlib.h>
3+
4+
struct inner
5+
{
6+
uint32_t exts[32]; // 32 is the minimum to crash
7+
};
8+
9+
struct outer
10+
{
11+
struct inner ctx; // Nesting is necessary
12+
};
13+
14+
int main()
15+
{
16+
struct outer *s = malloc(sizeof(struct outer));
17+
if (s != NULL)
18+
s->ctx.exts[0] = 0;
19+
}
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)