fix test segfaults caused by uninitialized memory #739
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.
while preparing shim 16.0 for our Debian Bookworm based Debian derivative, I noticed the
test_get_variable_0
andtest_gnvn_0
tests failing (depending on SHIM_DEBUG value).taking a closer look with gdb breaking at
test-mock-variables.c:310
for thetest_get_variable_0
case:with Debian Trixie the test case passes, because there is no random memory contents at that location (slightly newer GCC 12, but might be some other cofounding factor affecting the memory layout or initialization):
in case there won't be any non-CONFIG_ONLY vars added later in the array, simple setting the first skipped entry to
NULL
and breaking the loop should also work.