Fix: lttng-sessiond: nb_events is uninitialized
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 1 Mar 2022 14:03:45 +0000 (09:03 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 1 Mar 2022 19:12:04 +0000 (14:12 -0500)
Reported by Coverity:

    CID 1475823: Uninitialized scalar variable (UNINIT)
    Using uninitialized value nb_events.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I623b1ed0c1ef9b4acddb1e46e7311dfcdc974629

src/bin/lttng-sessiond/cmd.cpp

index 0627ba5c8bd5f83ca62d9403cddea283a2ce6f8f..ad3bbb387cc2df442d31fcaf9d77ad0c57ccaaf8 100644 (file)
@@ -3830,7 +3830,7 @@ enum lttng_error_code cmd_list_events(enum lttng_domain_type domain,
        enum lttng_error_code ret_code = LTTNG_OK;
        struct lttcomm_list_command_header reply_command_header = {};
        size_t reply_command_header_offset;
-       unsigned int nb_events;
+       unsigned int nb_events = 0;
 
        assert(reply_payload);
 
This page took 0.028584 seconds and 4 git commands to generate.