From: Jonathan Rajotte Date: Tue, 17 May 2016 15:52:47 +0000 (-0400) Subject: Fix: initialize the cur_event variable before using it X-Git-Tag: v2.7.3~37 X-Git-Url: http://git.liburcu.org/?p=lttng-tools.git;a=commitdiff_plain;h=684d7890cab7ed9cf530546bb22b3364b64538a5 Fix: initialize the cur_event variable before using it CID 1243041 (#1 of 1): Uninitialized scalar variable (UNINIT) uninit_use_in_call: Using uninitialized element of array *cur_event.name when calling strcmp. Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c index 108925eec..e4c029e29 100644 --- a/src/bin/lttng/commands/list.c +++ b/src/bin/lttng/commands/list.c @@ -565,6 +565,8 @@ static int mi_list_ust_event_fields(struct lttng_event_field *fields, int count, int event_element_open = 0; struct lttng_event cur_event; + memset(&cur_event, 0, sizeof(cur_event)); + /* Open domains element */ ret = mi_lttng_domains_open(writer); if (ret) {