From ea207e3b32e5159cfd9d1f15c36028bf707fc1ed Mon Sep 17 00:00:00 2001 From: David Goulet Date: Tue, 28 May 2013 14:57:05 -0400 Subject: [PATCH] Fix: wrong size in memcpy of kernel channel padding Issue 1019925 of coverity scan. Signed-off-by: David Goulet --- src/common/kernel-ctl/kernel-ctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/kernel-ctl/kernel-ctl.c b/src/common/kernel-ctl/kernel-ctl.c index b45efd0ef..d850f38c0 100644 --- a/src/common/kernel-ctl/kernel-ctl.c +++ b/src/common/kernel-ctl/kernel-ctl.c @@ -99,7 +99,7 @@ int kernctl_open_metadata(int fd, struct lttng_channel_attr *chops) channel.switch_timer_interval = chops->switch_timer_interval; channel.read_timer_interval = chops->read_timer_interval; channel.output = chops->output; - memcpy(channel.padding, chops->padding, sizeof(channel.padding)); + memcpy(channel.padding, chops->padding, sizeof(chops->padding)); return ioctl(fd, LTTNG_KERNEL_METADATA, &channel); } @@ -134,7 +134,7 @@ int kernctl_create_channel(int fd, struct lttng_channel_attr *chops) channel.switch_timer_interval = chops->switch_timer_interval; channel.read_timer_interval = chops->read_timer_interval; channel.output = chops->output; - memcpy(channel.padding, chops->padding, sizeof(channel.padding)); + memcpy(channel.padding, chops->padding, sizeof(chops->padding)); return ioctl(fd, LTTNG_KERNEL_CHANNEL, &channel); } -- 2.34.1