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

Explicitly use wrapping arithmetic operations when overflow may occur #467

Open
vobst opened this issue May 14, 2024 · 0 comments
Open

Explicitly use wrapping arithmetic operations when overflow may occur #467

vobst opened this issue May 14, 2024 · 0 comments
Labels
good first issue Good for newcomers

Comments

@vobst
Copy link
Collaborator

vobst commented May 14, 2024

The cwe_checker developers have mostly been compiling their code in release mode when testing it. Since dynamic overflow checks for integer arithmetic are not enabled in release mode you will encounter frequent panics when using debug builds.

For the most part, the panicking code is probably/hopefully correct. However, it should still explicitly opt-in to overflow by using the wrapping operations.

To help with this issue:

  • Compile the cwe_checker in debug mode and apply it to a somewhat large program ~>= 700KiB. Chances are good that it will panic due to arithmetic overflow.
  • Check the offending code and decide if it is correct or not.
  • Submit a PR that either fixes the bug or changes the code to explicitly opt-in to overflow.

Thanks!

@vobst vobst added the good first issue Good for newcomers label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant