diff options
author | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-10 14:19:14 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-11 19:32:17 +0200 |
commit | c0decac19da3906d9b66291e57b7759489e1170f (patch) | |
tree | 0eeb1f7d2c5464e0c87e0c788fd8fb581662c621 /drivers/media/radio/si4713 | |
parent | media: MAINTAINERS: add entry for i.MX PXP media mem2mem driver (diff) | |
download | linux-c0decac19da3906d9b66291e57b7759489e1170f.tar.xz linux-c0decac19da3906d9b66291e57b7759489e1170f.zip |
media: use strscpy() instead of strlcpy()
The implementation of strscpy() is more robust and safer.
That's now the recommended way to copy NUL terminated strings.
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/radio/si4713')
-rw-r--r-- | drivers/media/radio/si4713/radio-platform-si4713.c | 6 | ||||
-rw-r--r-- | drivers/media/radio/si4713/radio-usb-si4713.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/drivers/media/radio/si4713/radio-platform-si4713.c b/drivers/media/radio/si4713/radio-platform-si4713.c index 27339ec495f6..733fcf3933e4 100644 --- a/drivers/media/radio/si4713/radio-platform-si4713.c +++ b/drivers/media/radio/si4713/radio-platform-si4713.c @@ -67,10 +67,10 @@ static const struct v4l2_file_operations radio_si4713_fops = { static int radio_si4713_querycap(struct file *file, void *priv, struct v4l2_capability *capability) { - strlcpy(capability->driver, "radio-si4713", sizeof(capability->driver)); - strlcpy(capability->card, "Silicon Labs Si4713 Modulator", + strscpy(capability->driver, "radio-si4713", sizeof(capability->driver)); + strscpy(capability->card, "Silicon Labs Si4713 Modulator", sizeof(capability->card)); - strlcpy(capability->bus_info, "platform:radio-si4713", + strscpy(capability->bus_info, "platform:radio-si4713", sizeof(capability->bus_info)); capability->device_caps = V4L2_CAP_MODULATOR | V4L2_CAP_RDS_OUTPUT; capability->capabilities = capability->device_caps | V4L2_CAP_DEVICE_CAPS; diff --git a/drivers/media/radio/si4713/radio-usb-si4713.c b/drivers/media/radio/si4713/radio-usb-si4713.c index 1ebbf0217142..23065ecce979 100644 --- a/drivers/media/radio/si4713/radio-usb-si4713.c +++ b/drivers/media/radio/si4713/radio-usb-si4713.c @@ -67,8 +67,8 @@ static int vidioc_querycap(struct file *file, void *priv, { struct si4713_usb_device *radio = video_drvdata(file); - strlcpy(v->driver, "radio-usb-si4713", sizeof(v->driver)); - strlcpy(v->card, "Si4713 FM Transmitter", sizeof(v->card)); + strscpy(v->driver, "radio-usb-si4713", sizeof(v->driver)); + strscpy(v->card, "Si4713 FM Transmitter", sizeof(v->card)); usb_make_path(radio->usbdev, v->bus_info, sizeof(v->bus_info)); v->device_caps = V4L2_CAP_MODULATOR | V4L2_CAP_RDS_OUTPUT; v->capabilities = v->device_caps | V4L2_CAP_DEVICE_CAPS; @@ -467,7 +467,7 @@ static int usb_si4713_probe(struct usb_interface *intf, radio->vdev.ctrl_handler = sd->ctrl_handler; radio->v4l2_dev.release = usb_si4713_video_device_release; - strlcpy(radio->vdev.name, radio->v4l2_dev.name, + strscpy(radio->vdev.name, radio->v4l2_dev.name, sizeof(radio->vdev.name)); radio->vdev.v4l2_dev = &radio->v4l2_dev; radio->vdev.fops = &usb_si4713_fops; |