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>
这个提交包含在:
@@ -860,8 +860,8 @@ static int viacam_enum_fmt_vid_cap(struct file *filp, void *priv,
|
||||
{
|
||||
if (fmt->index >= N_VIA_FMTS)
|
||||
return -EINVAL;
|
||||
strlcpy(fmt->description, via_formats[fmt->index].desc,
|
||||
sizeof(fmt->description));
|
||||
strscpy(fmt->description, via_formats[fmt->index].desc,
|
||||
sizeof(fmt->description));
|
||||
fmt->pixelformat = via_formats[fmt->index].pixelformat;
|
||||
return 0;
|
||||
}
|
||||
|
在新工单中引用
屏蔽一个用户