Skip to contentSkip to conversation

timblogiw: too large value for strncpy()

PATCH New Dan Carpenter 1 participant 1 message Dec 20, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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).

drivers/media/video/timblogiw.c +1 -1
index cf48aa9..ef1b7a5 100644
@@ -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 |