mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
media: vicodec: fix memchr() kernel oops
commit cb3b2ffb75 upstream.
The size passed to memchr is too large as it assumes the search
starts at the start of the buffer, but it can start at an offset.
Cc: <stable@vger.kernel.org> # for v4.19 and up
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c4dabf3708
commit
663bfc44d1
@@ -438,7 +438,8 @@ restart:
|
||||
for (; p < p_out + sz; p++) {
|
||||
u32 copy;
|
||||
|
||||
p = memchr(p, magic[ctx->comp_magic_cnt], sz);
|
||||
p = memchr(p, magic[ctx->comp_magic_cnt],
|
||||
p_out + sz - p);
|
||||
if (!p) {
|
||||
ctx->comp_magic_cnt = 0;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user