Reject NULL channel list entries in exr_attr_chlist_duplicate()#2473
Open
cary-ilm wants to merge 1 commit into
Open
Reject NULL channel list entries in exr_attr_chlist_duplicate()#2473cary-ilm wants to merge 1 commit into
cary-ilm wants to merge 1 commit into
Conversation
Validate num_channels > 0 with entries == NULL before pointer arithmetic, covering exr_set_channels() and exr_attr_set_channels(). Also, refactor exr_attr_set_channels to call exr_attr_chlist_duplicate() since it does the same work. Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-mqmw-xv8w-5jh4 Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Cary Phillips <cary@ilm.com>
|
I guess this is ok, although I feel like I had a specific example where there were 0 channels in the channel list entry (like the old library supported this), and so allowed an "empty" channel list. If you have a test case for this, could you run it against a 2.x version of exr to see what the reader would do? Somewhat separately, but related, I do think we should entertain an exr part with no image data (which would have no channels in it), although that by definition shouldn't then have a channel list attribute, but that channel list pointer in the part would be null and num_channels would be 0... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Validate num_channels > 0 with entries == NULL before pointer arithmetic, covering exr_set_channels() and exr_attr_set_channels().
Also, refactor exr_attr_set_channels to call exr_attr_chlist_duplicate() since it does the same work.
Addresses https://github.com/AcademySoftwareFoundation/openexr/security/advisories/GHSA-mqmw-xv8w-5jh4