Fix: sessiond: timer: unitiliazed sigevent fields
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 10 Feb 2021 19:25:57 +0000 (14:25 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 23 Feb 2021 16:08:12 +0000 (11:08 -0500)
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 <jeremie.galarneau@efficios.com>
Change-Id: I306ea7e58192223408fac9d354dbbfebe6c0cc70

src/bin/lttng-sessiond/timer.c

index c65df5c2dc132706b1a6335e0d73ecff10eabf00..f6c545c9d0117b21eaf73e1b778fbc1d79a7871e 100644 (file)
@@ -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;
This page took 0.026067 seconds and 4 git commands to generate.