Fix: consumer: timer: uninitialized sigevent fields
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 11 Feb 2021 15:28:54 +0000 (10:28 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 11 Feb 2021 15:28:54 +0000 (10:28 -0500)
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 <jeremie.galarneau@efficios.com>
Change-Id: If9154d8b20699a88bf549c407eaef898dfebcd51

src/common/consumer/consumer-timer.c

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