Skip to content

fix(pdf): preflight source objects before parsing - #119

Merged
McanKul merged 1 commit into
developmentfrom
fix/33-object-preflight
Oct 4, 2026
Merged

McanKul merged 1 commit into
developmentfrom
fix/33-object-preflight

Conversation

@McanKul

@McanKul McanKul commented Oct 4, 2026

Copy link
Copy Markdown
Owner

What

  • scan object-header candidates before lopdf parses them and bound object count/nesting
  • reject recursive /Length chains beyond the classifier budget
  • decode object streams with per-stream and aggregate caps, then nesting-check their members

Why

This keeps crafted source PDFs from driving unbounded recursion or object-stream decoding in the read-only text classifier.

Verification

  • cargo test --manifest-path src-tauri/Cargo.toml --lib (302 passed)
  • cargo test --manifest-path src-tauri/Cargo.toml --lib source_content (45 passed)
  • rustfmt --check and git diff --check

Scope

Read-only classifier only: no command, UI, mutation, release, or main changes. This intentionally does not complete #33; raw xref preflight and bounded operator parsing remain separate follow-up PRs.

Refs #33

@McanKul
McanKul merged commit 28493aa into development Oct 4, 2026
2 checks passed
@McanKul
McanKul deleted the fix/33-object-preflight branch October 4, 2026 16:02
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