Skip to content

[reverse] Guard low-memory parsing by bounding Flate decode and image payload retention#7

Closed
vitormattos wants to merge 13 commits into
fork/libresign-parser-fixesfrom
fix/flate-decode-memory-guard
Closed

[reverse] Guard low-memory parsing by bounding Flate decode and image payload retention#7
vitormattos wants to merge 13 commits into
fork/libresign-parser-fixesfrom
fix/flate-decode-memory-guard

Conversation

@vitormattos
Copy link
Copy Markdown
Owner

@vitormattos vitormattos commented Apr 24, 2026

Reverse PR for upstream submission: smalot#801

Summary

  • derive a conservative effective Flate decode cap when decodeMemoryLimit is not explicitly configured
  • apply the same cap to the compress.zlib fallback path
  • skip retaining image stream payloads when PHP memory is constrained
  • add focused regression coverage in DocumentIssueFocusTest for PullRequest457.pdf

Validation

  • low-memory reproduction (128M) now completes and returns 28 pages
  • focused PHPUnit checks pass in smalot-pdf-bench:local

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos vitormattos force-pushed the fix/flate-decode-memory-guard branch from 401b916 to 10c7ffa Compare April 24, 2026 04:06
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos vitormattos changed the base branch from master to fork/libresign-parser-fixes April 24, 2026 15:19
@vitormattos
Copy link
Copy Markdown
Owner Author

This branch is already included in fork/libresign-all-fixes and is now validated through the aggregate gate PR #8, so this reverse PR is no longer needed.

@vitormattos
Copy link
Copy Markdown
Owner Author

Closing as redundant after aggregating this branch into fork/libresign-all-fixes and opening #8 as the CI gate.

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