Fix GH-11020: spurious "Illegal IFD size" warning in exif_read_data()#22486
Open
eyupcanakman wants to merge 1 commit into
Open
Fix GH-11020: spurious "Illegal IFD size" warning in exif_read_data()#22486eyupcanakman wants to merge 1 commit into
eyupcanakman wants to merge 1 commit into
Conversation
When an IFD is not followed by a 4-byte next-IFD offset, the EXIF block has no further IFD. Treat that as the end of the chain and return the parsed tags, instead of warning and discarding them. The bounds check from bug #72094 still applies, so the absent offset bytes are never read.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
exif_read_data()emits a spurious "Illegal IFD size" warning on valid JPEGs whose EXIF block ends right after the IFD entries, with no next-IFD offset following them. The bounds check added for bug #72094 treats that absent offset as an error. A missing offset means there is no further IFD, so the fix returns the parsed tags instead of warning. cmb69 diagnosed this on the issue. The out-of-bounds read the check guards stays intact, because those bytes are never read.Adds a test, and confirms
bug72094.phptstill rejects the malformed inputs.