From: Jérémie Galarneau Date: Fri, 5 May 2017 20:07:43 +0000 (-0400) Subject: Fix: use of uninitialized channel attributes in client X-Git-Tag: v2.10.0-rc1~6 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=c1e4642cd27bd5b70c0eca1011d9e452bd24f018;hp=d279f57d9fdfb56bce521780402fca0319ede0fc Fix: use of uninitialized channel attributes in client The channel attributes used to retrieve the defaults to use are not zero-initialized which is a problem now that the extended pointer is used to determine whether or not the structure was allocated on stack by the user (for backward compatibility) or dynamically using the new lttng_channel_create() interface. Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng/commands/enable_channels.c b/src/bin/lttng/commands/enable_channels.c index 950cdb67e..22331cec2 100644 --- a/src/bin/lttng/commands/enable_channels.c +++ b/src/bin/lttng/commands/enable_channels.c @@ -108,6 +108,8 @@ static void set_default_attr(struct lttng_domain *dom) { struct lttng_channel_attr default_attr; + memset(&default_attr, 0, sizeof(default_attr)); + /* Set attributes */ lttng_channel_set_default_attr(dom, &default_attr);