Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROB: Prevent loop in Cloning #1770

Merged
merged 3 commits into from
Apr 7, 2023
Merged

ROB: Prevent loop in Cloning #1770

merged 3 commits into from
Apr 7, 2023

Conversation

pubpub-zz
Copy link
Collaborator

fixes #1767
the issue is due to object 589/0 : this object corresponds to 2 object the file trailer but also an XObject corresponding to the filled text ("test") because of that the object tries to be duplicated inducing the loop. This loop is not normal and I've fixed as a robustness improvement. If you run your code the text "test" will be missing as it is hidden by the trailer object.

fixes  py-pdf#1767
the issue is due to object 589/0 : this object corresponds to 2 object the file trailer but also an XObject corresponding to the filled text ("test") because of that the object tries to be duplicated inducing the loop. This loop is not normal and I've fixed as a robustness improvement. If you run your code the text "test" will be missing as it is hidden by the trailer object.
@codecov
Copy link

codecov bot commented Apr 6, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (b385ce9) 92.41% compared to head (52df465) 92.41%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1770   +/-   ##
=======================================
  Coverage   92.41%   92.41%           
=======================================
  Files          34       34           
  Lines        6576     6581    +5     
  Branches     1301     1302    +1     
=======================================
+ Hits         6077     6082    +5     
  Misses        326      326           
  Partials      173      173           
Impacted Files Coverage Δ
pypdf/_protocols.py 100.00% <ø> (ø)
pypdf/generic/_base.py 100.00% <100.00%> (ø)
pypdf/generic/_data_structures.py 90.13% <100.00%> (ø)

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@pubpub-zz
Copy link
Collaborator Author

@MartinThoma all yours :)

@MartinThoma MartinThoma changed the title ROB : Prevent loop in Cloning ROB: Prevent loop in Cloning Apr 7, 2023
@MartinThoma MartinThoma merged commit f26388e into py-pdf:main Apr 7, 2023
@MartinThoma
Copy link
Member

Thank you 🤗

MartinThoma added a commit that referenced this pull request Apr 9, 2023
Security (SEC):
-  Warn about PDF encryption security (#1755)

Robustness (ROB):
-  Prevent loop in Cloning (#1770)
-  Capture UnicodeDecodeError at PdfReader.pdf_header (#1768)

Documentation (DOC):
-  Pin myst_parser==0.16.1 and rename .readthedocs.yaml (#1752)
-  Add readthedocs.yml and bump docs dependencies using `tox -e deps` (#1750)

Developer Experience (DEV):
-  Make make_changelog.py idempotent

Maintenance (MAINT):
-  Move generation of file identifiers to a method (#1760)

Testing (TST):
-  Add xmp test (#1775)

Code Style (STY):
-  Improve language, add docstrings, fix TODOs (#1772)
-  Test names, docstrings, and parametrization (#1771)

[Full Changelog](3.7.0...3.7.1)
@pubpub-zz pubpub-zz deleted the clone_loop branch June 24, 2023 08:42
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.

Issue with merging pdfs with annotations
2 participants