Skip to content

mprintf: fix the integer overflow checks#15699

Closed
bagder wants to merge 1 commit intomasterfrom
bagder/mprintf-overflows
Closed

mprintf: fix the integer overflow checks#15699
bagder wants to merge 1 commit intomasterfrom
bagder/mprintf-overflows

Conversation

@bagder
Copy link
Member

@bagder bagder commented Dec 6, 2024

When a floating point precision or string width are provided as a base-10 number, the code could miss to detect integer overflows if the provided value was exactly 2147483648 or 2147483649 (2147483647 being the maxium value a signed integer can hold).

The chance that such values would actually ever be used is slim.

This change fixes the detection to also cover those edge cases.

When a floating point precision or string width are provided as a
base-10 number, the code could miss to detect integer overflows if the
provided value was exactly 2147483648 or 2147483649 (2147483647 being
the maxium value a signed integer can hold).

The chance that such values would actually ever be used is slim.

This change fixes the detection to also cover those edge cases.
@bagder bagder closed this in 59fec5a Dec 6, 2024
@bagder bagder deleted the bagder/mprintf-overflows branch December 6, 2024 15:39
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
When a floating point precision or string width are provided as a
base-10 number, the code could miss to detect integer overflows if the
provided value was exactly 2147483648 or 2147483649 (2147483647 being
the maxium value a signed integer can hold).

The chance that such values would actually ever be used is slim.

This change fixes the detection to also cover those edge cases.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant