Skip to content

prevent overflow of int with bit shifting when initializing hash table#4

Open
corentin-prigent wants to merge 1 commit into
ISCDtoolbox:olderVersionThatWorksfrom
corentin-prigent:fix_integer_overflow
Open

prevent overflow of int with bit shifting when initializing hash table#4
corentin-prigent wants to merge 1 commit into
ISCDtoolbox:olderVersionThatWorksfrom
corentin-prigent:fix_integer_overflow

Conversation

@corentin-prigent

Copy link
Copy Markdown

Integer overflow may happen during initialization of hash table. Bit shifting to the last bit (2 << 30) creates an undefined quantity that causes the do while condition to be falsely evaluated. Advising to use macro INT_MAX instead of bit shifting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant