Skip to content

Fix Zip64 extra field offset computation in readCentralDirectoryFileHeader (#731)#731

Open
terrelln wants to merge 1 commit into
facebook:devfrom
terrelln:export-D103841972
Open

Fix Zip64 extra field offset computation in readCentralDirectoryFileHeader (#731)#731
terrelln wants to merge 1 commit into
facebook:devfrom
terrelln:export-D103841972

Conversation

@terrelln
Copy link
Copy Markdown
Contributor

@terrelln terrelln commented May 5, 2026

Summary:

The Zip64 extended information extra field only includes entries for CDFH fields that overflow to 0xFFFFFFFF. The old code used hardcoded offsets (16 for header offset, 0 for compressed size), which assumed all preceding fields were always present. This caused corruption errors on zip files where only some fields used Zip64.

Fix by computing the offset dynamically based on which preceding CDFH fields actually overflowed. Also thread opCtx through the zip lexer for proper error reporting.

Differential Revision: D103841972

@meta-cla meta-cla Bot added the cla signed label May 5, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented May 5, 2026

@terrelln has exported this pull request. If you are a Meta employee, you can view the originating Diff in D103841972.

@meta-codesync meta-codesync Bot changed the title Fix Zip64 extra field offset computation in readCentralDirectoryFileHeader Fix Zip64 extra field offset computation in readCentralDirectoryFileHeader (#731) May 5, 2026
@terrelln terrelln force-pushed the export-D103841972 branch from 516f6c8 to 41af40a Compare May 5, 2026 17:59
terrelln added a commit to terrelln/openzl that referenced this pull request May 5, 2026
…eader (facebook#731)

Summary:

The Zip64 extended information extra field only includes entries for CDFH fields that overflow to 0xFFFFFFFF. The old code used hardcoded offsets (16 for header offset, 0 for compressed size), which assumed all preceding fields were always present. This caused corruption errors on zip files where only some fields used Zip64.

Fix by computing the offset dynamically based on which preceding CDFH fields actually overflowed. Also thread `opCtx` through the zip lexer for proper error reporting.

Differential Revision: D103841972
terrelln added a commit to terrelln/openzl that referenced this pull request May 5, 2026
…eader (facebook#731)

Summary:

The Zip64 extended information extra field only includes entries for CDFH fields that overflow to 0xFFFFFFFF. The old code used hardcoded offsets (16 for header offset, 0 for compressed size), which assumed all preceding fields were always present. This caused corruption errors on zip files where only some fields used Zip64.

Fix by computing the offset dynamically based on which preceding CDFH fields actually overflowed. Also thread `opCtx` through the zip lexer for proper error reporting.

Differential Revision: D103841972
@terrelln terrelln force-pushed the export-D103841972 branch from 41af40a to 468a966 Compare May 5, 2026 18:39
…eader (facebook#731)

Summary:

The Zip64 extended information extra field only includes entries for CDFH fields that overflow to 0xFFFFFFFF. The old code used hardcoded offsets (16 for header offset, 0 for compressed size), which assumed all preceding fields were always present. This caused corruption errors on zip files where only some fields used Zip64.

Fix by computing the offset dynamically based on which preceding CDFH fields actually overflowed. Also thread `opCtx` through the zip lexer for proper error reporting.

Differential Revision: D103841972
@terrelln terrelln force-pushed the export-D103841972 branch from 468a966 to c221398 Compare May 5, 2026 19:48
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