Skip to content

fix: Avoid panic on overflow when parsing --size#2035

Open
tmccombs wants to merge 1 commit into
sharkdp:masterfrom
tmccombs:size-overflow
Open

fix: Avoid panic on overflow when parsing --size#2035
tmccombs wants to merge 1 commit into
sharkdp:masterfrom
tmccombs:size-overflow

Conversation

@tmccombs

@tmccombs tmccombs commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Avoid panic if the argument to --size would result in an integer
overflow when multiplying by the unit.

Actually, it's worse in release builds, because the multiplying won't
panic, and will instead silently wrap around.

Thanks to @Bojun-Vvibe for the original PR

Avoid panic if the argument to --size would result in an integer
overflow when multiplying by the unit.

Actually, it's worse in release builds, because the multiplying *won't*
panic, and will instead silently wrap around.
@tmccombs tmccombs requested a review from tavianator June 25, 2026 07:48
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.

1 participant