Skip to content

Fix GH-10834: exif_read_data() cannot read smaller stream wrapper chunk sizes #10924

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

Closed
wants to merge 3 commits into from

Conversation

nielsdos
Copy link
Member

@nielsdos nielsdos commented Mar 24, 2023

php_stream_read() may return less than the requested amount of bytes by design. This patch introduces a static function for exif which reads from the stream in a loop until all the requested bytes are read.

Test was
Co-authored-by: dotpointer

This is attempt nr 2 at fixing this because the previous attempt modified the stream core code which was undesired.
cc'ing @Girgias & @bukka because they looked at the previous version of the patch.

@nielsdos nielsdos requested review from bukka and Girgias March 24, 2023 15:05
@nielsdos nielsdos linked an issue Mar 24, 2023 that may be closed by this pull request
…chunk sizes

php_stream_read() may return less than the requested amount of bytes by
design. This patch introduces a static function for exif which reads
from the stream in a loop until all the requested bytes are read.

Test was
Co-authored-by: dotpointer
@nielsdos nielsdos force-pushed the fix-10834-attempt-2 branch from 738cdc5 to f1314a1 Compare March 24, 2023 18:43
@Girgias
Copy link
Member

Girgias commented Mar 26, 2023

I'll let @bukka judge this. :)

@Girgias Girgias removed their request for review March 26, 2023 13:57
Copy link
Member

@bukka bukka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good in general. Just few comments added.

@nielsdos
Copy link
Member Author

Thanks for checking.
Addressed the review comments by dropping the FIXME comment and renaming the function.

@Girgias Girgias requested a review from bukka May 5, 2023 11:06
Copy link
Member

@bukka bukka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just few comments.

@nielsdos
Copy link
Member Author

Thanks, addressed the review comments.

@nielsdos nielsdos requested a review from bukka May 12, 2023 20:07
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.

exif_read_data() cannot read smaller stream wrapper chunk sizes
3 participants