Skip to content

date: reject absurd format-modifier widths before allocating#12652

Draft
sylvestre wants to merge 3 commits into
uutils:mainfrom
sylvestre:date-huge-width-12458
Draft

date: reject absurd format-modifier widths before allocating#12652
sylvestre wants to merge 3 commits into
uutils:mainfrom
sylvestre:date-huge-width-12458

Conversation

@sylvestre
Copy link
Copy Markdown
Contributor

A field width that fits in usize but is enormous (e.g. %6666666666666D) was handed straight to String::try_reserve. On a normal system that fails gracefully, but under a sanitizer the oversized request aborts the process before try_reserve can return an error. Cap the width up front instead.

Should make fuzz_date pass and closes #12458

A field width that fits in usize but is enormous (e.g. %6666666666666D)
was handed straight to String::try_reserve. On a normal system that fails
gracefully, but under a sanitizer the oversized request aborts the process
before try_reserve can return an error. Cap the width up front instead.

Should make fuzz_date pass.
@sylvestre sylvestre marked this pull request as draft June 5, 2026 20:59
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 5, 2026

GNU testsuite comparison:

Skip an intermittent issue tests/misc/io-errors (fails in this run but passes in the 'main' branch)

Comment thread src/uu/date/src/format_modifiers.rs Outdated
sylvestre and others added 2 commits June 6, 2026 07:49
Co-authored-by: xtqqczze <45661989+xtqqczze@users.noreply.github.com>
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.

fuzz_date failure

2 participants