-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Cleanup exif checks #10402
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
Cleanup exif checks #10402
Conversation
This condition will never trigger because otherwise the do-while loop wouldn't have exited.
nice catches ! |
@@ -3810,12 +3805,6 @@ static bool exif_scan_JPEG_header(image_info_type *ImageInfo) | |||
|
|||
fpos = php_stream_tell(ImageInfo->infile); | |||
|
|||
if (marker == 0xff) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could it be still somewhat useful (e.g. fuzzing) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand your question. This check can never be hit because of the do-while loop: if we get here marker must be !=0xff. Unless this code was meant to check in a different way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nevermind I misread the code it s clearer when unfolded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be a good idea to replace that with a ZEND_ASSERT()
, so it's easier to understand (and to also have a safeguard just in case the code above would be modified).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LCTM
Thanks! |
more in a context of a possible text change. follow-up on phpGH-10402.
Gets rid of two redundant checks.