Coverity reports:
1512891 Uninitialized scalar variable
The variable will contain an arbitrary value left from earlier computations.
In lttng_event_serialize(lttng_event const *, unsigned int, char
const * const *, char const *, unsigned long, lttng_bytecode *, lttng_payload *): Use of an uninitialized variable (CWE-457)
This warning is bogus since lttng_event_exclusion_comm contains a single
field which is already initialized and is packed (no padding possible).
Initialize the header explicitly to silence the warning.
Reported-by: Coverity Scan
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ia1eeee779168b3ac0eb9d0796d503b2d9ab225f2
for (i = 0; i < exclusion_count; i++) {
const size_t exclusion_len =
lttng_strnlen(*(exclusion_list + i), LTTNG_SYMBOL_NAME_LEN);
- struct lttng_event_exclusion_comm exclusion_header;
+ struct lttng_event_exclusion_comm exclusion_header = {};
exclusion_header.len = (uint32_t) exclusion_len + 1;