diff options
author | Laurent Pinchart <laurent.pinchart@skynet.be> | 2009-01-08 18:05:11 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 17:42:26 +0200 |
commit | d0ebf3073f8812464c9f6014d6cee09ab37c3fb5 (patch) | |
tree | cae1337ef45a319301a668c7cf16918283e6dbb4 /drivers/media/video/uvc/uvc_ctrl.c | |
parent | V4L/DVB (10291): em28xx: fix VIDIOC_G_CTRL when there is no msp34xx device. (diff) | |
download | linux-d0ebf3073f8812464c9f6014d6cee09ab37c3fb5.tar.xz linux-d0ebf3073f8812464c9f6014d6cee09ab37c3fb5.zip |
V4L/DVB (10293): uvcvideo: replace strn{cpy,cat} with strl{cpy,cat}.
strncpy is unsafe as it doesn't append a terminating NUL character when the
source string doesn't fit in the destination buffer. Replace it with strlcpy.
strncat is misused as its size argument refers to the source string, not the
destination buffer. Replace it with strlcat.
Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/uvc/uvc_ctrl.c')
-rw-r--r-- | drivers/media/video/uvc/uvc_ctrl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c index d2576f6391c0..0d7e38d6ff6a 100644 --- a/drivers/media/video/uvc/uvc_ctrl.c +++ b/drivers/media/video/uvc/uvc_ctrl.c @@ -786,7 +786,7 @@ int uvc_query_v4l2_ctrl(struct uvc_video_device *video, memset(v4l2_ctrl, 0, sizeof *v4l2_ctrl); v4l2_ctrl->id = mapping->id; v4l2_ctrl->type = mapping->v4l2_type; - strncpy(v4l2_ctrl->name, mapping->name, sizeof v4l2_ctrl->name); + strlcpy(v4l2_ctrl->name, mapping->name, sizeof v4l2_ctrl->name); v4l2_ctrl->flags = 0; if (!(ctrl->info->flags & UVC_CONTROL_SET_CUR)) |