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

More overflow related bug fixes #1402

Merged
merged 51 commits into from
Jan 18, 2022
Merged

More overflow related bug fixes #1402

merged 51 commits into from
Jan 18, 2022

Conversation

Eharve14
Copy link
Contributor

Ran through the open security issues identified by LGTM code analysis and added fixes for the relevant issues.

Eharve14 and others added 30 commits January 13, 2022 00:53
Removed automatically generated settings.json
…d for conformity, relocated check for num images for exicution before allocation and image loading
This reverts commit dbe64d6.
… unsigned for conformity, relocated check for num images for exicution before allocation and image loading"

This reverts commit ab6c7c7.
Added overflow protection in get_num_images function, redefined num_images to unsigned int in compress and decompress to match dump
…t exicution of allocation and strcpy if there are no images.
Copy link
Contributor Author

@Eharve14 Eharve14 left a comment

Choose a reason for hiding this comment

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

The change from I to J was because the type of I is UINT_16, type of max is UINT_32. j is defined as UINT_32

@rouault
Copy link
Collaborator

rouault commented Jan 18, 2022

The change from I to J was because the type of I is UINT_16, type of max is UINT_32. j is defined as UINT_32

ok, I don't think there was any issue in practice because the maximum number of components in a JPEG2000 file is 16384 and this is normally checked before

@Eharve14
Copy link
Contributor Author

If that check is always done, I agree that the change is not necessary. I made the edit because that check is not in the function with the iterator in the loop in question, and I did not do the leg work to ensure the check is present before every call to this function.

Also this is the only loop in that section of code with the type mismatch between the iterator and comparator.

@rouault rouault merged commit 241e9e8 into uclouvain:master Jan 18, 2022
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.

2 participants