Skip to content

Fix integer overflow in consume_integer() #30

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

Merged
merged 4 commits into from
Apr 10, 2025

Conversation

ligurio
Copy link
Owner

@ligurio ligurio commented Mar 27, 2025

Fixes #29

@ligurio ligurio changed the title fix integer overflow in consume_integer() Fix integer overflow in consume_integer() Apr 1, 2025
@ligurio ligurio force-pushed the ligurio/gh-29-integer-overflow branch 8 times, most recently from 4843836 to 8f3e5bc Compare April 8, 2025 18:13
ligurio added 2 commits April 9, 2025 13:45
Reported by cppcheck.
Follows up commit d2cb24d
("luzer: introduce oneof() in FuzzedDataProvider").
@ligurio ligurio force-pushed the ligurio/gh-29-integer-overflow branch 2 times, most recently from dba9490 to 2f08948 Compare April 9, 2025 17:08
@ligurio ligurio requested a review from Buristan April 9, 2025 17:15
@ligurio ligurio force-pushed the ligurio/gh-29-integer-overflow branch 4 times, most recently from df0fe40 to 2564876 Compare April 10, 2025 08:42
ligurio added 2 commits April 10, 2025 11:47
The implementation of FDP methods `consume_integer()` and
`consume_integers()` have used type `int` for passed arguments in
aforementioned functions. This leads to integer overflow.

Fixes #29
The implementation of FDP methods `consume_number()` and
`consume_numbers()` are used type `double` for arguments of
aforementioned functions. The Lua type `lua_Number` can be not a
`double` and it is defined compile-time. The patch replaces
`double` with `lua_Number` to avoid overflows.

Follows up #29
@ligurio ligurio force-pushed the ligurio/gh-29-integer-overflow branch from 2564876 to b694d25 Compare April 10, 2025 08:48
@ligurio ligurio merged commit 5455e15 into master Apr 10, 2025
10 checks passed
@ligurio ligurio deleted the ligurio/gh-29-integer-overflow branch April 10, 2025 08:51
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.

Integer overflow in consume_integer()
2 participants