Skip to content

fix: validate parser input and reuse checked binary reads - #1050

Merged
andiwand merged 1 commit into
mainfrom
review/32-parser-boundaries
Oct 5, 2026
Merged

andiwand merged 1 commit into
mainfrom
review/32-parser-boundaries

Conversation

@andiwand

@andiwand andiwand commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

Markdown inline code now replaces NUL bytes with U+FFFD; inputs exceeding md4c’s size type fail before narrowing. RTF rejects unreadable streams and uses the shared chunked byte reader for binary payloads. Legacy PowerPoint uses the same reader and rejects incomplete text records.

This removes both I/O calls from resize_and_overwrite callbacks, which cannot safely throw, and removes a duplicate chunk-reading implementation.

Validation: 83 Markdown, RTF, PowerPoint, and byte-reader tests pass. The new inline-code case failed before the fix; focused regressions cover unreadable streams, throwing reads, record boundaries, and oversized length claims. The multi-gigabyte Markdown size guard was reviewed without allocating a fixture.

@andiwand
andiwand force-pushed the review/31-ooxml-package-paths branch from 4b5e7c3 to 33b1165 Compare October 5, 2026 08:18
Base automatically changed from review/31-ooxml-package-paths to main October 5, 2026 08:25
@andiwand
andiwand force-pushed the review/32-parser-boundaries branch from e70f246 to c759c79 Compare October 5, 2026 08:29
@andiwand
andiwand merged commit 3e3fb35 into main Oct 5, 2026
23 checks passed
@andiwand
andiwand deleted the review/32-parser-boundaries branch October 5, 2026 08:39
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