Skip to content

Harden OptionConverter::toFileSize input validation#654

Merged
swebb2066 merged 1 commit into
apache:masterfrom
jmestwa-coder:strict-filesize-parser-validation
May 10, 2026
Merged

Harden OptionConverter::toFileSize input validation#654
swebb2066 merged 1 commit into
apache:masterfrom
jmestwa-coder:strict-filesize-parser-validation

Conversation

@jmestwa-coder
Copy link
Copy Markdown
Contributor

Description

  • Harden OptionConverter::toFileSize to require full validation of size strings instead of accepting partially parsed values.

  • Reject malformed, negative, trailing-junk, and overflowed inputs such as:

    • 123abc
    • 10XB
    • 10MBjunk
    • -1MB
  • Preserve documented valid formats including:

    • 10
    • 10B
    • 10 KB
    • 10MB
    • lowercase suffixes (10kb, 10mb, 10gb)
  • Add regression coverage for:

    • valid inputs
    • whitespace-separated suffixes
    • lowercase suffix handling
    • malformed input rejection
    • overflow and boundary handling

@swebb2066 swebb2066 merged commit b4cde33 into apache:master May 10, 2026
17 checks passed
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.

2 participants