From: Jérémie Galarneau Date: Thu, 11 Feb 2021 15:28:54 +0000 (-0500) Subject: Fix: consumer: timer: uninitialized sigevent fields X-Git-Tag: v2.13.0-rc1~334 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=389b8e8fd446dee925166205c0f6e462babd5e5d;p=lttng-tools.git Fix: consumer: timer: uninitialized sigevent fields Coverity reports: 1445769 Uninitialized scalar variable The variable will contain an arbitrary value left from earlier computations. In consumer_channel_timer_start: Use of an uninitialized variable (CWE-457) CID 1445769 (#1 of 1): Uninitialized scalar variable (UNINIT)7. uninit_use_in_call: Using uninitialized value sev. Field sev._sigev_un is uninitialized when calling timer_create. Reported-by: Coverity Scan Signed-off-by: Jérémie Galarneau Change-Id: If9154d8b20699a88bf549c407eaef898dfebcd51 --- diff --git a/src/common/consumer/consumer-timer.c b/src/common/consumer/consumer-timer.c index c190d3b62..aba2bbb41 100644 --- a/src/common/consumer/consumer-timer.c +++ b/src/common/consumer/consumer-timer.c @@ -368,7 +368,7 @@ int consumer_channel_timer_start(timer_t *timer_id, unsigned int timer_interval_us, int signal) { int ret = 0, delete_ret; - struct sigevent sev; + struct sigevent sev = {}; struct itimerspec its; assert(channel);