Skip to content

Add out-of-bounds check for memset and memcpy#1197

Merged
michael-schwarz merged 23 commits intogoblint:masterfrom
mrstanb:memset-memcpy-size-check
Oct 1, 2023
Merged

Add out-of-bounds check for memset and memcpy#1197
michael-schwarz merged 23 commits intogoblint:masterfrom
mrstanb:memset-memcpy-size-check

Conversation

@mrstanb
Copy link
Copy Markdown
Member

@mrstanb mrstanb commented Sep 29, 2023

This PR adds a check for the count and n parameter of memset and memcpy

  • base should now be able to warn in case count or n is bigger than the smallest memory, pointed-to by dest
  • Added a regession test case for this as well

Copy link
Copy Markdown
Member

@michael-schwarz michael-schwarz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's still quite a few kinks to be ironed out, just let me know if any of my comments are cryptic or unclear!

@mrstanb
Copy link
Copy Markdown
Member Author

mrstanb commented Oct 1, 2023

Hopefully all remarks are now fixed. I also migrated the memset/memcpy checks completely from base to memOutOfBounds for consistency's sake. Feel free to review :)

Copy link
Copy Markdown
Member

@michael-schwarz michael-schwarz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be good to go after adding back the one TODO I commented on.

@michael-schwarz michael-schwarz merged commit d3347e8 into goblint:master Oct 1, 2023
@sim642 sim642 added this to the SV-COMP 2024 milestone Nov 15, 2023
sim642 added a commit to sim642/opam-repository that referenced this pull request Nov 24, 2023
nberth pushed a commit to nberth/opam-repository that referenced this pull request Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants