1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
Description: Fix uninitialized value in make_cgreen_integer_value
The make_cgreen_integer_value() function could leave parts of the
CgreenValue.value union uninitialized. This was investigated as a
potential fix for a build failure observed on the i386 architecture
within the Debian Sid packaging environment.
Author: Gavin Lai <gavin09@gmail.com>
Last-Update: 2025-09-08
Forwarded: https://github.com/cgreen-devs/cgreen/pull/334
---
--- a/src/cgreen_value.c
+++ b/src/cgreen_value.c
@@ -18,7 +18,10 @@
}
CgreenValue make_cgreen_integer_value(intptr_t integer) {
- CgreenValue value = {CGREEN_INTEGER, {0}, sizeof(intptr_t)};
+ CgreenValue value;
+ value.type = CGREEN_INTEGER;
+ value.value_size = sizeof(intptr_t);
+ memset(&value.value, 0, sizeof(value.value));
value.value.integer_value = integer;
return value;
}
|