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

Fixed signedness of image size #3165

Merged

Conversation

Lemongrass3110
Copy link
Contributor

Pull Request Prelude

Changes Proposed

Issues addressed:
Image size is 59454, which is > INT16_MAX.
Therefore uint16 should be used.
The rest of the code should also be checked, as it uses int32 instead of int16 in general.

@MishimaHaruna MishimaHaruna added this to the Release v2022.11.02 milestone Oct 15, 2022
Copy link
Member

@MishimaHaruna MishimaHaruna left a comment

Choose a reason for hiding this comment

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

Thank you. The rest of the code seems reasonably safe. The only places that could use some improvement are the clif_macro_detector_request_init() and clif_captcha_preview_request_init() functions where the downcast to uint16 occurs.
Not strictly necessary since their input value is originally 16 bit so it should in theory never be larger than that, but to be on the safe side, an Assert_retv(image_size >= 0 && image_size <= UINT16_MAX) would be enough

@MishimaHaruna MishimaHaruna added the hacktoberfest-accepted Easy-to-tackle issues label Oct 21, 2022
@MishimaHaruna MishimaHaruna merged commit 9cb6808 into HerculesWS:master Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Easy-to-tackle issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants