Skip to content

Address reuse of malloc cannot be detected #2117

Open
@peterschrammel

Description

@peterschrammel

CBMC returns VERIFICATION SUCCESSFUL for the following program, although the assertion can fail.

void main()
{
  int *x = malloc(sizeof(int));
  free(x);
  int *y = malloc(sizeof(int));
  if(x == y) {
    // should be reachable
    assert(0);
  }
  free(y);
}

CBMC's object encoding assumes that malloc never returns the same address.

Metadata

Metadata

Labels

Pointer ModellingVersion 6Pull requests and issues requiring a major version bumpawsBugs or features of importance to AWS CBMC userssoundnessSoundness bug? Review and add "aws" if it is, or remove "soundness" if it isn't.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions