-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Description
Component
printf
Description
When parsing width/precision values in format strings, printf does not properly handle integer overflow. When extremely large values are passed, the eat_number function causes the process to panic and crash due to unwrap().
Under GNU:
❯ printf '%999999999999999999999999d' 1
1Under uutils:
❯ printf '%999999999999999999999999d' 1
thread 'main' panicked at src/uucore/src/lib/features/format/spec.rs:599:18:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: PosOverflow }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtraceTest / Reproduction Steps
# Provide commands and setup to reproduceImpact
The process panicked and crashed.
Reactions are currently unavailable