From: Dan Carpenter Date: Mon, 20 Dec 2010 12:53:16 +0000 (-0300) Subject: [media] timblogiw: too large value for strncpy() X-Git-Tag: v2.6.38-rc1~470^2~104 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dcd745b723efc875ec5a8f44be028bd0704b12d6;p=profile%2Fivi%2Fkernel-x86-ivi.git [media] timblogiw: too large value for strncpy() This is a copy and paste error. It should be using sizeof(cap->driver) instead of sizeof(cap->card). Signed-off-by: Dan Carpenter Cc: Richard Rojförs Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/timblogiw.c b/drivers/media/video/timblogiw.c index cf48aa9..700c08a 100644 --- a/drivers/media/video/timblogiw.c +++ b/drivers/media/video/timblogiw.c @@ -241,7 +241,7 @@ static int timblogiw_querycap(struct file *file, void *priv, dev_dbg(&vdev->dev, "%s: Entry\n", __func__); memset(cap, 0, sizeof(*cap)); strncpy(cap->card, TIMBLOGIWIN_NAME, sizeof(cap->card)-1); - strncpy(cap->driver, DRIVER_NAME, sizeof(cap->card)-1); + strncpy(cap->driver, DRIVER_NAME, sizeof(cap->driver) - 1); strlcpy(cap->bus_info, vdev->name, sizeof(cap->bus_info)); cap->version = TIMBLOGIW_VERSION_CODE; cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING |