Skip to content

overflow in toFileSize causing incorrect log rotation limits#646

Merged
swebb2066 merged 1 commit into
apache:masterfrom
jmestwa-coder:tofilesize-overflow-log-rotation
May 7, 2026
Merged

overflow in toFileSize causing incorrect log rotation limits#646
swebb2066 merged 1 commit into
apache:masterfrom
jmestwa-coder:tofilesize-overflow-log-rotation

Conversation

@jmestwa-coder
Copy link
Copy Markdown
Contributor

Summary

Fixes an integer overflow in OptionConverter::toFileSize that can break log rotation.


Problem

Extremely large values (e.g. "9999999999999999999999GB") can overflow a signed long, become negative, and then convert to a very large size_t.
This results in log rotation never triggering.


Fix

  • Use strtoll for parsing
  • Reject overflow, negative values, and out-of-range results
  • Safely fall back to defaultValue

Test

Adds a deterministic test to verify large inputs no longer produce unrealistic file size limits.

@swebb2066 swebb2066 merged commit 85daf4e into apache:master May 7, 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