Skip to content

A simplified example that triggers issue 6230, from @SaswatPadhi #6243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions regression/cbmc/array-bug-6230/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <stdint.h>
#include <stdlib.h>

struct inner
{
uint32_t exts[32]; // 32 is the minimum to crash
};

struct outer
{
struct inner ctx; // Nesting is necessary
};

int main()
{
struct outer *s = malloc(sizeof(struct outer));
if(s != NULL)
s->ctx.exts[0] = 0;
}
8 changes: 8 additions & 0 deletions regression/cbmc/array-bug-6230/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
main.c
--malloc-may-fail --malloc-fail-null --pointer-check
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
A simplified test case that triggers issue #6230