Fix: error-query: uninitialized action_index value
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 22 Apr 2021 18:50:55 +0000 (14:50 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 22 Apr 2021 18:52:10 +0000 (14:52 -0400)
action_index will be used uninitialized if the user passes an action
that is not part of the trigger (an API use error).

CID 1452662 (#2 of 2): Uninitialized scalar variable (UNINIT)
14. uninit_use: Using uninitialized value action_index.is_set.

Reported-by: Coverity Scan
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I9afc6730b5462f4bf55e0dba3454efb5b4ca22c9

src/common/error-query.c

index a3663ad7c72e3bccd8926a28e2655459729655c5..8bee203977ddec1c27a6b399f53b78a4e6ceb479 100644 (file)
@@ -127,7 +127,7 @@ extern struct lttng_error_query *lttng_error_query_action_create(
                const struct lttng_action *action)
 {
        struct lttng_error_query_action *query = NULL;
-       typeof(query->action_index) action_index;
+       typeof(query->action_index) action_index = {};
        struct lttng_trigger *trigger_copy = NULL;
 
        if (!trigger || !action) {
This page took 0.026679 seconds and 4 git commands to generate.