From mboxrd@z Thu Jan 1 00:00:00 1970 From: jeremie.galarneau@efficios.com (=?UTF-8?Q?J=C3=A9r=C3=A9mie_Galarneau?=) Date: Wed, 18 May 2016 15:22:30 -0400 Subject: [lttng-dev] [PATCH lttng-tools] Fix: initialize the cur_event variable before using it In-Reply-To: <1463500367-23547-1-git-send-email-jonathan.rajotte-julien@efficios.com> References: <1463500367-23547-1-git-send-email-jonathan.rajotte-julien@efficios.com> Message-ID: Merged, thanks! Jérémie On Tue, May 17, 2016 at 11:52 AM, Jonathan Rajotte wrote: > 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 > --- > src/bin/lttng/commands/list.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c > index 0dd74e5..418fccf 100644 > --- a/src/bin/lttng/commands/list.c > +++ b/src/bin/lttng/commands/list.c > @@ -621,6 +621,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) { > -- > 2.7.4 > -- Jérémie Galarneau EfficiOS Inc. http://www.efficios.com