提交 24e2fb61 编写于 作者: R Roel Kluin 提交者: Steve French

cifs: Read buffer overflow

Check whether index is within bounds before testing the element.
Acked-by: NJeff Layton <jlayton@redhat.com>
Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: NSteve French <sfrench@us.ibm.com>
上级 4486d6ed
......@@ -44,7 +44,7 @@ cifs_ucs2_bytes(const __le16 *from, int maxbytes,
int maxwords = maxbytes / 2;
char tmp[NLS_MAX_CHARSET_SIZE];
for (i = 0; from[i] && i < maxwords; i++) {
for (i = 0; i < maxwords && from[i]; i++) {
charlen = codepage->uni2char(le16_to_cpu(from[i]), tmp,
NLS_MAX_CHARSET_SIZE);
if (charlen > 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册