mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 03:06:10 +00:00
cifs: Read buffer overflow
Check whether index is within bounds before testing the element. Acked-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
This commit is contained in:
parent
4486d6ede1
commit
24e2fb615f
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue