Skip to content

Commit

Permalink
cifs: Increase size of tmp_buf in cifs_readdir to avoid potential ove…
Browse files Browse the repository at this point in the history
…rflows

Increase size of tmp_buf to possible maximum to avoid potential
overflows.

Pointed-out-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de>
Acked-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
  • Loading branch information
Suresh Jayaraman authored and Steve French committed Apr 20, 2009
1 parent 968460e commit 7b0c8fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/cifs/readdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
with the rare long characters alloc more to account for
such multibyte target UTF-8 characters. cifs_unicode.c,
which actually does the conversion, has the same limit */
tmp_buf = kmalloc((2 * NAME_MAX) + 4, GFP_KERNEL);
tmp_buf = kmalloc((4 * NAME_MAX) + 2, GFP_KERNEL);
for (i = 0; (i < num_to_fill) && (rc == 0); i++) {
if (current_entry == NULL) {
/* evaluate whether this case is an error */
Expand Down

0 comments on commit 7b0c8fc

Please sign in to comment.