Skip to content

fix: bound Word metadata and character piece reads - #1053

Merged
andiwand merged 2 commits into
mainfrom
review/35-doc-table-bounds
Oct 5, 2026
Merged

andiwand merged 2 commits into
mainfrom
review/35-doc-table-bounds

Conversation

@andiwand

@andiwand andiwand commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

Legacy Word now bounds Clx and font-table reads by the FIB’s declared lengths and rejects incomplete piece-table bodies. PLC entries use the shared checked byte reader instead of potentially unaligned pointer casts. Character pieces must be contiguous, cover the body, and fit the stream-offset range; index lookups respect exclusive ends and iterator ownership.

Validation: 14 Word/encryption tests and 17 DOC corpus cases pass; the encrypted corpus case remains skipped. Existing font and document fixtures now exercise short declared tables and missing body coverage. Two focused tests cover PLC alignment/index bounds and character-range boundaries.

@andiwand
andiwand force-pushed the review/34-doc-fib-storage branch from 653bedc to aa33203 Compare October 5, 2026 08:59
Base automatically changed from review/34-doc-fib-storage to main October 5, 2026 09:01
andiwand and others added 2 commits October 5, 2026 11:02
The bounded font table now threw for an odd byte after a name, a name
without its NUL and a nonzero cbExtra. The old reader skipped the first
and the last, and took a name without NUL whole. The font table only
affects styling, so one quirky name stopped the whole document. Inside
the declared length, the reader again tolerates these cases. An FFN
shorter than its fixed part still throws.

AGENTS.md lists the cases and is wrapped at 80 columns again.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gb1fLafqqzehpqPuU6uBfn
@andiwand
andiwand force-pushed the review/35-doc-table-bounds branch from 4594dc0 to c1bbcc0 Compare October 5, 2026 09:06
@andiwand
andiwand merged commit f516e2b into main Oct 5, 2026
23 checks passed
@andiwand
andiwand deleted the review/35-doc-table-bounds branch October 5, 2026 09:16
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