-
Notifications
You must be signed in to change notification settings - Fork 8k
Various fixes to exif/heic support #19745
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
Conversation
6f75e1f
to
7dcdc1a
Compare
43a3909
to
04d4067
Compare
Rebased. |
Nice catches in the review, thanks! I updated it with the issues (hopefully) fixed. |
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.
Looks good to me!
It is illegal to construct out-of-bound pointers, even if they are not dereferenced. The current bound checks rely on undefined behaviour. Fix this by introducing convenience macros that check the remaining length.
The loop checks against `p` but increases `p2`. I don't see the point of having 2 separate variables, so use `p` instead to correct the bounds check and simplify the code in the process.
…ile size We change the order of operations such that the file size check cannot overflow in the for loop. This prevents infinite loops. We also add an overflow check at the end of the loop body to prevent the addition of offset and box.size from overflowing.
60a1bed
to
b90d65f
Compare
Rebased and cleaned up the history. Will merge on green CI. |
I just doubled checked this and it all looks good. Nice work. It was really buggy - I didn't do a good job in review apparently - need to do more checking next time. |
Well I found few but apparently also missed few as well but good that fuzzer is running on it as some of this would be security issues most likely... |
Parsing code tends to be tricky. It's always good to look with a few different people as it's very easy to miss issues. |
No description provided.