]> git.ipfire.org Git - thirdparty/curl.git/commit
mprintf: fix the integer overflow checks
authorDaniel Stenberg <daniel@haxx.se>
Fri, 6 Dec 2024 15:01:50 +0000 (16:01 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 6 Dec 2024 15:38:30 +0000 (16:38 +0100)
commit59fec5ac43ade98b31093e707b5ac2aba305bd2a
tree30dc8eb6d09fa03a347ae68d70e22e9f3e176004
parentec14be6a4db9d2767552dcbf52ece3f23b7a51b0
mprintf: fix the integer overflow checks

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 #15699
lib/mprintf.c