old_channel.switch_timer_interval = chops->switch_timer_interval;
old_channel.read_timer_interval = chops->read_timer_interval;
old_channel.output = chops->output;
- memcpy(old_channel.padding, chops->padding, sizeof(old_channel.padding));
+
+ memset(old_channel.padding, 0, sizeof(old_channel.padding));
+ /*
+ * The new channel padding is smaller than the old ABI so we use the
+ * new ABI padding size for the memcpy.
+ */
+ memcpy(old_channel.padding, chops->padding, sizeof(chops->padding));
return ioctl(fd, LTTNG_KERNEL_OLD_METADATA, &old_channel);
}
old_channel.switch_timer_interval = chops->switch_timer_interval;
old_channel.read_timer_interval = chops->read_timer_interval;
old_channel.output = chops->output;
- memcpy(old_channel.padding, chops->padding, sizeof(old_channel.padding));
+
+ memset(old_channel.padding, 0, sizeof(old_channel.padding));
+ /*
+ * The new channel padding is smaller than the old ABI so we use the
+ * new ABI padding size for the memcpy.
+ */
+ memcpy(old_channel.padding, chops->padding, sizeof(chops->padding));
return ioctl(fd, LTTNG_KERNEL_OLD_CHANNEL, &old_channel);
}