projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
56315e5
)
staging/most: Remove all strcpy() uses in favor of strscpy()
author
Len Baker
<len.baker@gmx.com>
Sat, 17 Jul 2021 16:05:12 +0000
(18:05 +0200)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Tue, 27 Jul 2021 13:10:41 +0000
(15:10 +0200)
strcpy() performs no bounds checking on the destination buffer. This
could result in linear overflows beyond the end of the buffer, leading
to all kinds of misbehaviors. The safe replacement is strscpy().
Signed-off-by: Len Baker <len.baker@gmx.com>
Link:
https://lore.kernel.org/r/20210717160512.16176-1-len.baker@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/most/video/video.c
patch
|
blob
|
history
diff --git
a/drivers/staging/most/video/video.c
b/drivers/staging/most/video/video.c
index 90933d78c332523307373a24b01f74df13ed0328..b7858e47145fa1c43d4d2c2034ab717e7bc876b9 100644
(file)
--- a/
drivers/staging/most/video/video.c
+++ b/
drivers/staging/most/video/video.c
@@
-258,7
+258,7
@@
static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
if (f->index)
return -EINVAL;
- str
cpy(f->description, "MPEG"
);
+ str
scpy(f->description, "MPEG", sizeof(f->description)
);
f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
f->flags = V4L2_FMT_FLAG_COMPRESSED;
f->pixelformat = V4L2_PIX_FMT_MPEG;
@@
-306,7
+306,7
@@
static int vidioc_enum_input(struct file *file, void *priv,
if (input->index >= V4L2_CMP_MAX_INPUT)
return -EINVAL;
- str
cpy(input->name, "MOST Video"
);
+ str
scpy(input->name, "MOST Video", sizeof(input->name)
);
input->type |= V4L2_INPUT_TYPE_CAMERA;
input->audioset = 0;