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

Avoid potential integer overflow in QuickTimeVideo::userDataDecoder #2347

Merged
merged 1 commit into from
Sep 7, 2022

Conversation

kevinbackhouse
Copy link
Collaborator

I'm worried about what will happen if size is between 1 and 11. I think it could cause an integer overflow.

Copy link
Contributor

@benmccann benmccann left a comment

Choose a reason for hiding this comment

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

I might be missing something, but these seem exactly equivalent to me. That being said, I think the new version is written in a clearer manner

@kevinbackhouse
Copy link
Collaborator Author

I might be missing something, but these seem exactly equivalent to me. That being said, I think the new version is written in a clearer manner

@benmccann: the type of size is size_t which is unsigned, so if for example size == 5 then size - 12 will integer overflow and become a very large positive number, which means that this comparison won't work as intended.

@kevinbackhouse kevinbackhouse merged commit 2482159 into Exiv2:main Sep 7, 2022
@kevinbackhouse kevinbackhouse deleted the quicktimevideo-size-calc branch September 7, 2022 07:08
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.

3 participants