Skip to content

harden filename construction against integer overflow and OOB access#4637

Open
metsw24-max wants to merge 1 commit intofacebook:devfrom
metsw24-max:fileio-filename-overflow-hardening
Open

harden filename construction against integer overflow and OOB access#4637
metsw24-max wants to merge 1 commit intofacebook:devfrom
metsw24-max:fileio-filename-overflow-hardening

Conversation

@metsw24-max
Copy link
Copy Markdown

This patch hardens filename construction logic in fileio.c against integer overflow, out-of-bounds access, and unsafe string operations.

Added precomputed length handling and overflow-checked capacity calculation

Fixed separator logic when output directory is empty to avoid out-of-bounds indexing

Added explicit destination-capacity overflow guards in compressed-name generation

Replaced unsafe suffix write with length-aware copy

@meta-cla meta-cla bot added the CLA Signed label Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant