Skip to content
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

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

Merged
merged 23 commits into from
Oct 1, 2023

Conversation

mrstanb
Copy link
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
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!

src/analyses/base.ml Outdated Show resolved Hide resolved
src/analyses/base.ml Outdated Show resolved Hide resolved
src/analyses/base.ml Outdated Show resolved Hide resolved
src/analyses/base.ml Outdated Show resolved Hide resolved
src/analyses/base.ml Outdated Show resolved Hide resolved
tests/regression/77-mem-oob/06-memset-memcpy-oob.c Outdated Show resolved Hide resolved
@mrstanb
Copy link
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
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
9 checks passed
@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