Fix: use of uninitialized channel attributes in client
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 5 May 2017 20:07:43 +0000 (16:07 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 5 May 2017 20:09:53 +0000 (16:09 -0400)
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 <jeremie.galarneau@efficios.com>
src/bin/lttng/commands/enable_channels.c

index 950cdb67e671e61cc164e1d050ba5454ec3bd0e7..22331cec2b2ead8d032ede422df7f581df4f7c38 100644 (file)
@@ -108,6 +108,8 @@ static void set_default_attr(struct lttng_domain *dom)
 {
        struct lttng_channel_attr default_attr;
 
 {
        struct lttng_channel_attr default_attr;
 
+       memset(&default_attr, 0, sizeof(default_attr));
+
        /* Set attributes */
        lttng_channel_set_default_attr(dom, &default_attr);
 
        /* Set attributes */
        lttng_channel_set_default_attr(dom, &default_attr);
 
This page took 0.025282 seconds and 4 git commands to generate.