From: Jérémie Galarneau Date: Wed, 10 Feb 2021 19:25:57 +0000 (-0500) Subject: Fix: sessiond: timer: unitiliazed sigevent fields X-Git-Tag: v2.13.0-rc1~337 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f79ead11cbfdcb99de17bac20c357bba159c5e66;p=lttng-tools.git Fix: sessiond: timer: unitiliazed sigevent fields Coverity reports: 1445773 Uninitialized scalar variable The variable will contain an arbitrary value left from earlier computations. In timer_start: Use of an uninitialized variable (CWE-457) CID 1445773 (#1 of 1): Uninitialized scalar variable (UNINIT)2. 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: I306ea7e58192223408fac9d354dbbfebe6c0cc70 --- diff --git a/src/bin/lttng-sessiond/timer.c b/src/bin/lttng-sessiond/timer.c index 56fc4635a..f67aac4d0 100644 --- a/src/bin/lttng-sessiond/timer.c +++ b/src/bin/lttng-sessiond/timer.c @@ -144,7 +144,7 @@ int timer_start(timer_t *timer_id, struct ltt_session *session, unsigned int timer_interval_us, int signal, bool one_shot) { int ret = 0, delete_ret; - struct sigevent sev; + struct sigevent sev = {}; struct itimerspec its; sev.sigev_notify = SIGEV_SIGNAL;