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.11.7~23 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=54b393a43bf05fc453c609a8c3532250733e3759;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 c65df5c2d..f6c545c9d 100644 --- a/src/bin/lttng-sessiond/timer.c +++ b/src/bin/lttng-sessiond/timer.c @@ -154,7 +154,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;