fix oob read on empty array initializer in convertInitializerList#4350
Open
saddamr3e wants to merge 1 commit into
Open
fix oob read on empty array initializer in convertInitializerList#4350saddamr3e wants to merge 1 commit into
saddamr3e wants to merge 1 commit into
Conversation
|
|
arcady-lunarg
approved these changes
Jul 23, 2026
Contributor
|
@saddamr3e I think you'll need to re-sign the CLA because they changed to a different CLA. |
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.
ASan, on a shader with a nested empty initializer list:
The array branch reads getSequence()[0] to derive inner array dimensions but never checks the initializer list is non-empty. A nested {} (an empty EOpNull aggregate, legal under GL_EXT_null_initializer) that lands on an array element type reaches it with a zero-length sequence, so the index runs past the end. The struct/matrix/vector branches already validate the count first, and the HLSL convertInitializerList guards the same read with size() > 0. Reject the empty list with an error to match.
Repro:
int a[1][3] = { {} };with GL_EXT_null_initializer. Test added under gtests AST (glsl.nullInitializer.error.vert).