From cc1e6315e83db0e517dd9279050b88adc83a7eba Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 10 Sep 2018 16:20:42 -0400 Subject: media: replace strcpy() by strscpy() The strcpy() function is being deprecated upstream. Replace it by the safer strscpy(). Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/usb/hdpvr/hdpvr-video.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'drivers/media/usb/hdpvr') diff --git a/drivers/media/usb/hdpvr/hdpvr-video.c b/drivers/media/usb/hdpvr/hdpvr-video.c index 9ab071f8993d..e082086428a4 100644 --- a/drivers/media/usb/hdpvr/hdpvr-video.c +++ b/drivers/media/usb/hdpvr/hdpvr-video.c @@ -578,8 +578,8 @@ static int vidioc_querycap(struct file *file, void *priv, { struct hdpvr_device *dev = video_drvdata(file); - strcpy(cap->driver, "hdpvr"); - strcpy(cap->card, "Hauppauge HD PVR"); + strscpy(cap->driver, "hdpvr", sizeof(cap->driver)); + strscpy(cap->card, "Hauppauge HD PVR", sizeof(cap->card)); usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info)); cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_AUDIO | V4L2_CAP_READWRITE; @@ -1238,7 +1238,8 @@ int hdpvr_register_videodev(struct hdpvr_device *dev, struct device *parent, /* setup and register video device */ dev->video_dev = hdpvr_video_template; - strcpy(dev->video_dev.name, "Hauppauge HD PVR"); + strscpy(dev->video_dev.name, "Hauppauge HD PVR", + sizeof(dev->video_dev.name)); dev->video_dev.v4l2_dev = &dev->v4l2_dev; video_set_drvdata(&dev->video_dev, dev); -- cgit v1.2.3