Repository navigation
fix: enforce PowerPoint record and formatting bounds - #1051
Merged
Merged
Conversation
andiwand
force-pushed
the
review/32-parser-boundaries
branch
from
October 5, 2026 08:29
e70f246 to
c759c79
Compare
A formatting run past the end of its text now threw, and the exception refused the whole presentation. Writers do not always get the counts exactly right, so the run is now cut to the remaining text, as LibreOffice does. style_pending already gives characters after the last run the default style. A body that ends inside a run still throws. The embedded-BLIP check required the BLIP to fill its store entry exactly, although it reports a BLIP that exceeds it. It now refuses only a larger BLIP, and the cursor consumes the bytes that were read, so padding is skipped. ppt_style.cpp also includes <algorithm> and <stdexcept>, which it uses. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gb1fLafqqzehpqPuU6uBfn
andiwand
force-pushed
the
review/33-ppt-record-bounds
branch
from
October 5, 2026 08:45
e8d8950 to
856d022
Compare
The ppt reader had its own skip_bytes. A skip that stops short is the same failure as a short read, so byte_stream::skip now sits next to read and throws the same error. It skips a count above streamsize in steps, so the caller needs no range check. The ppt reader uses it in all four places. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gb1fLafqqzehpqPuU6uBfn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 Generated with Claude Code
Legacy PowerPoint now rejects truncated records and skipped payloads, incomplete persist/property arrays, and pictures extending beyond their store entry. A formatting run past the end of its text is cut, as LibreOffice does. Text-container nesting is bounded, and frame dimensions widen coordinates before subtraction.
Picture decoding now has one shared body reader for direct, embedded, and delayed images. Formatting consumes a remaining-character budget instead of accumulating potentially overflowing counts.
Validation: 15 PowerPoint and legacy-encryption tests pass, including both existing PPT corpus fixtures and four focused synthetic regressions. The fixtures cover record boundaries, nesting, formatting coverage, and extreme anchor coordinates.