mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] Large overflow in __intscan ignored
@ 2023-12-01  5:08 Anuraag Agrawal
  2023-12-01  5:14 ` [musl] " Anuraag Agrawal
  2023-12-01 16:21 ` [musl] " Markus Wichmann
  0 siblings, 2 replies; 8+ messages in thread
From: Anuraag Agrawal @ 2023-12-01  5:08 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 525 bytes --]

Currently, __intscan, used by functions like strtol, does not seem to check
for overflow during multiplication.

https://git.musl-libc.org/cgit/musl/tree/src/internal/intscan.c#n69

It at the end checks against the limit, e.g. the size of a long

https://git.musl-libc.org/cgit/musl/tree/src/internal/intscan.c#n90

However, if the value overflows and ends up in the range of the limit,
errno will not be set. It seems that each multiplication operation needs to
be checking for overflow and return errno if it ever happens.

[-- Attachment #2: Type: text/html, Size: 831 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-02-26  1:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-01  5:08 [musl] Large overflow in __intscan ignored Anuraag Agrawal
2023-12-01  5:14 ` [musl] " Anuraag Agrawal
2023-12-01 15:52   ` Rich Felker
2023-12-01 16:21 ` [musl] " Markus Wichmann
2023-12-02  1:42   ` Anuraag Agrawal
2023-12-02  8:48     ` Markus Wichmann
2023-12-02 16:29       ` Rich Felker
2024-02-26  1:30         ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).