Skip to content

v1.1.0

Choose a tag to compare

@SudoStar SudoStar released this 10 Oct 07:23
· 145 commits to main since this release
3cafbbd

gopdfrab 1.1.0 is a hardening release: no breaking changes, a handful of
additions, and fixes for crashes, wrong verdicts and lost content that hostile
or damaged input could cause.

Highlights

  • Panics become errors: a panic inside gopdfrab, including one in an internal
    worker goroutine, is recovered at the public entry points and returned wrapping
    the new ErrInternal, instead of crashing the caller's process.
  • Atomic Save: ConvertResult.Save writes a temp file beside the target and
    renames it into place, so a failed save no longer truncates an existing file,
    including the input when converting in place.
  • Cancellation that takes effect: VerifyContext polls the context during the
    object-graph walk, and Convert's raster passes stop dispatching page renders
    once it is cancelled.
  • Hostile-input hardening: a stream /Length past the end of the file, an
    out-of-range xref stream offset, long runs of comment lines and a self-listing
    /Kids can no longer crash the process or exhaust memory.
  • Encryption: revision 5 (AES-256, Adobe Extension Level 3) now
    authenticates; it used to reject every password, including the correct one.
  • Convert honesty: a stream whose /Filter used an inline-image abbreviation
    (/Fl) could be reported valid while its content was unreadable. Abbreviations
    are now expanded, and the decode cache keys on the filter chain.
  • Damage recovery: a badly wrong stream /Length is recovered from
    endstream instead of losing the stream, one bad object no longer loses its
    whole object stream, and header/xref recovery scans are 4–7× faster.
  • Batch and CLI: VerifyAllContext honours Options.Workers; the CLI reads
    --password from $GOPDFRAB_PASSWORD, which unlike the flag is not visible
    in ps.

Behaviour changes

No public symbol changed. Two results are more correct than before, which the
stability policy treats as fixes:

  • 6.1.7/6.1.8 framing issues are document-level now, with the object in
    ObjectRef(). They used to report the object number as Page().
  • 6.1.12 IndirectObjectsExceeded fires on more than 8,388,607 indirect objects.
    It used to fire on an empty cross-reference table.

Install

go get github.com/voidrab/gopdfrab@v1.1.0
go install github.com/voidrab/gopdfrab/cmd/gopdfrab@v1.1.0

Or download a CLI binary below. They are static, built with CGO_ENABLED=0;
verify with sha256sum -c checksums.txt.

The full list of additions, changes and fixes is in
CHANGELOG.md.