X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Fkernel-ctl%2Fkernel-ctl.c;h=610a3c53b4cce80dec3fa3896eb3b5b7dd313b5b;hb=a499920804d9367d78d5bf0b8f327b0c0029ba5d;hp=3295c0baa716c97e463337c9e3c4ce61b2991367;hpb=05019b80c3829b30a3da62b912b1070c9e3b918f;p=lttng-tools.git diff --git a/src/common/kernel-ctl/kernel-ctl.c b/src/common/kernel-ctl/kernel-ctl.c index 3295c0baa..610a3c53b 100644 --- a/src/common/kernel-ctl/kernel-ctl.c +++ b/src/common/kernel-ctl/kernel-ctl.c @@ -84,10 +84,12 @@ int kernctl_create_session(int fd) /* open the metadata global channel */ int kernctl_open_metadata(int fd, struct lttng_channel_attr *chops) { - struct lttng_kernel_old_channel old_channel; struct lttng_kernel_channel channel; if (lttng_kernel_use_old_abi) { + struct lttng_kernel_old_channel old_channel; + + memset(&old_channel, 0, sizeof(old_channel)); old_channel.overwrite = chops->overwrite; old_channel.subbuf_size = chops->subbuf_size; old_channel.num_subbuf = chops->num_subbuf; @@ -105,6 +107,7 @@ int kernctl_open_metadata(int fd, struct lttng_channel_attr *chops) return ioctl(fd, LTTNG_KERNEL_OLD_METADATA, &old_channel); } + memset(&channel, 0, sizeof(channel)); channel.overwrite = chops->overwrite; channel.subbuf_size = chops->subbuf_size; channel.num_subbuf = chops->num_subbuf; @@ -234,6 +237,7 @@ int kernctl_create_event(int fd, struct lttng_kernel_event *ev) if (lttng_kernel_use_old_abi) { struct lttng_kernel_old_event old_event; + memset(&old_event, 0, sizeof(old_event)); memcpy(old_event.name, ev->name, sizeof(old_event.name)); old_event.instrumentation = ev->instrumentation; switch (ev->instrumentation) { @@ -270,6 +274,7 @@ int kernctl_add_context(int fd, struct lttng_kernel_context *ctx) if (lttng_kernel_use_old_abi) { struct lttng_kernel_old_context old_ctx; + memset(&old_ctx, 0, sizeof(old_ctx)); old_ctx.ctx = ctx->ctx; /* only type that uses the union */ if (ctx->ctx == LTTNG_KERNEL_CONTEXT_PERF_CPU_COUNTER) {