提交 d1fec5bd 编写于 作者: D Dan Carpenter 提交者: Mauro Carvalho Chehab

[media] atomisp: one char read beyond end of string

We should verify that "ix < max_len" before we test whether we have
reached the NUL terminator.

Fixes: a49d2536 ("staging/atomisp: Add support for the Intel IPU v2")
Reported-by: NDavid Binderman <dcb314@hotmail.com>
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
上级 02d97831
...@@ -72,9 +72,8 @@ static size_t strnlen_s( ...@@ -72,9 +72,8 @@ static size_t strnlen_s(
return 0; return 0;
} }
for (ix=0; for (ix = 0; ix < max_len && src_str[ix] != '\0'; ix++)
((src_str[ix] != '\0') && (ix< max_len)); ;
++ix) /*Nothing else to do*/;
/* On Error, it will return src_size == max_len*/ /* On Error, it will return src_size == max_len*/
return ix; return ix;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册