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>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
07f7db4ce7
commit
d0ebf3073f
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user