Skip to content

Conversation

@cozdas
Copy link
Collaborator

@cozdas cozdas commented Jan 5, 2026

Addressing Issue #2228 - Heap-use-after-free in OpenColorIO::ThrowInvalidRegex

This turned out to be not a UAF issue but an out-of-bounds-access issue where the throw was accessing the incorrect (and potentially shorter) string with an index derived from another (and potentially longer) string.

… in OpenColorIO::ThrowInvalidRegex

This turned out to be not a UAF issue but an out-of-bounds-access issue where the throw was accessing the incorrect (and potentially shorter) string with an index derived from another (and potentially longer) string.

Signed-off-by: cuneyt.ozdas <cuneyt.ozdas@autodesk.com>
if (globString[idx] == ']')
{
ThrowInvalidRegex(globPattern, globPattern + idx);
ThrowInvalidRegex(globPattern, &globString[idx]);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

idx is looping through the globString content which is a potentially longer string (for example when ignore space is true, which expands every alpha character to [xX] string). So it was trying to access pass end of globPattern.

@doug-walker doug-walker changed the title Addressing Issue #2228 - Heap-use-after-free in OpenColorIO::ThrowInvalidRegex Issue #2228 - Out-of-bounds issue in ThrowInvalidRegex Jan 6, 2026
Copy link
Contributor

@KevinJW KevinJW left a 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.

Finding this kind of bug in this code, not that surprising

@KevinJW KevinJW added this to the OCIO 2.5.1 milestone Jan 6, 2026
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