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

Attempt to fix #659 (gzuncompress(): data error) #690

Closed
wants to merge 1 commit into from

Conversation

k00ni
Copy link
Collaborator

@k00ni k00ni commented Mar 13, 2024

Type of pull request

  • Bug fix (involves code and configuration changes)

About

This PR is about the error in #659 (gzuncompress(): data error). Will fix #659

@NickHahac Currently I try to exploit the error, but your test data is not working (binary?). Could help me with the unit test?

Checklist for code / configuration changes

In case you changed the code/configuration, please read each of the following checkboxes as they contain valuable information:

  • Please add at least one test case (unit test, system test, ...) to demonstrate that the change is working. If existing code was changed, your tests cover these code parts as well.

@k00ni k00ni self-assigned this Mar 13, 2024
@k00ni
Copy link
Collaborator Author

k00ni commented Apr 2, 2024

I googled for a while, but was not able to create an example to let gzuncompress run into the data error problem. Unfortunately, the code you posted doesn't work for me still (used PHP 7.4.x):

$data = '�s��8�S4z�2A�ٮ��������n�O���)q,�ӕ�ik�7l�B:��<Lgz?��C�/�UL�"XZ�@���ui~-�����٥~�&K��"&8_�E����A�f***@***.***�Kj��s����!3�Q�<�������#ŀ>�����3�|�L';

Maybe the characters got altered when pasting them inside an issue-textbox here?

My last idea is you create a pull request against the branch fix/issue-659-gz-uncompress-data-error (https://github.com/smalot/pdfparser/tree/fix/issue-659-gz-uncompress-data-error) and add your data here so the test triggers the data error warning: https://github.com/smalot/pdfparser/pull/690/files#diff-235727ecb69058b18625467133a4011eedea250a8842a96ae4c6e9c1b4f372cdR151-R155


Altogether, I am still wondering why the E_WARNING is not suppressed by @ before gzuncompress.

@k00ni
Copy link
Collaborator Author

k00ni commented Apr 2, 2024

They changed the behavior of the STFU operator @ in PHP 8.0, based on https://php.watch/versions/8.0/fatal-error-suppression

But still, it should silence E_WARNINGs like "data error".

@k00ni
Copy link
Collaborator Author

k00ni commented Apr 9, 2024

@NickHahac: I am inclined to close this (and maybe #659 too) because we can't reproduce it.

@k00ni
Copy link
Collaborator Author

k00ni commented Apr 29, 2024

Closed due to inactivity.

@k00ni k00ni closed this Apr 29, 2024
@k00ni k00ni added the stale needs decision label Apr 29, 2024
@k00ni k00ni deleted the fix/issue-659-gz-uncompress-data-error branch November 5, 2024 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gzuncompress(): data error
1 participant