Skip to content

fix: retain CFB stream metadata and traversal context - #1034

Merged
andiwand merged 1 commit into
mainfrom
review/16-cfb-ownership
Oct 4, 2026
Merged

andiwand merged 1 commit into
mainfrom
review/16-cfb-ownership

Conversation

@andiwand

@andiwand andiwand commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

A CFB stream retained a pointer to metadata owned by its file wrapper, although streams can outlive that wrapper. Copy the small directory entry into the stream buffer. Nested directory walks now retain the boundary between inner and outer sibling stacks, so a child's siblings finish before traversal returns to its parent. Unwinding directories is iterative.

The binary reader also uses checked sector reads, widens directory offsets before multiplication on 32-bit targets, and avoids fetching the next sector after the requested bytes are complete. Packed fields use std::array, with layout-size assertions, and their comments are shorter.

Two regressions cover stream ownership and a synthetic nested CFB tree. Validation: 38 CFB, legacy Office, crypto and document-file tests passed.

@andiwand
andiwand force-pushed the review/15-edit-integers branch from 76476c7 to 43af35d Compare October 4, 2026 21:05
Base automatically changed from review/15-edit-integers to main October 4, 2026 21:07
@andiwand
andiwand force-pushed the review/16-cfb-ownership branch from acb9369 to 56ae165 Compare October 4, 2026 21:11
@andiwand
andiwand merged commit 867a082 into main Oct 4, 2026
23 checks passed
@andiwand
andiwand deleted the review/16-cfb-ownership branch October 4, 2026 21:12
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.

1 participant