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

Cast to uintmax_t *before* multiplying in space calculations #133

Merged
merged 1 commit into from
Jul 30, 2021

Commits on Jul 30, 2021

  1. Cast to uintmax_t *before* multiplying in space calculations

    This ensures that all cases where the result actually does fit in a
    uintmax_t are correctly handled. Before, the multiplication could be
    performed in a smaller type, leading to an incorrect result or, worse,
    undefined behavior due to signed integer overflow.
    
    This fixes a test failure that was actually observed on an i686 Linux
    system.
    musicinmybrain committed Jul 30, 2021
    Configuration menu
    Copy the full SHA
    924d84a View commit details
    Browse the repository at this point in the history