size string copies by str_len in copy_str_to_string_list#1926
Merged
Conversation
|
Author aizu-m not on autobuild list. Waiting for curator authorization before starting CI build. |
1 similar comment
|
Author aizu-m not on autobuild list. Waiting for curator authorization before starting CI build. |
charles-lunarg
approved these changes
Jun 8, 2026
charles-lunarg
left a comment
Collaborator
There was a problem hiding this comment.
Whoops, I'm sure I meant sizeof(char) instead. But considering that is basically always 1, and when its not, we have to do more work than just adjust the size (looking at you windows), there isn't a great reason to keep the sizeof.
|
CI Vulkan-Loader build queued with queue ID 764221. |
|
CI Vulkan-Loader build # 3531 running. |
|
CI Vulkan-Loader build # 3531 passed. |
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.
copy_str_to_string_list / copy_str_to_start_of_string_list, sizing a 57-byte manifest path:
str_len is the length of one string, not a count of pointers. The sizeof(char ) factor belongs to create_string_list right above, which allocates the char array, and got copied into these two char-buffer allocations. Every manifest path and enabled layer name copied through them lands in a buffer about eight times larger than needed. The loader_strncpy bound uses the same inflated size, so nothing overflows, it just over-allocates.
Spotted while reading the string-list helpers next to create_string_list. Size both buffers by str_len + 1 to match the element.