summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuresh Jayaraman <sjayaraman@suse.de>2009-05-09 11:33:12 +0530
committerGreg Kroah-Hartman <gregkh@suse.de>2009-05-18 16:34:59 -0700
commita7a7d2fe8813c3bee7d7db9ba889fc2c2dd39dd7 (patch)
tree02fa7c2dbf0dbd6c5895185c82a84c75a7d42b7b
parent9381701c0f0722ffc1dab1c55ecd48f6d0b5be6f (diff)
cifs: Fix buffer size in cifs_convertUCSpath
Relevant commits 7fabf0c9479fef9fdb9528a5fbdb1cb744a744a4 and f58841666bc22e827ca0dcef7b71c7bc2758ce82. The upstream commits adds cifs_from_ucs2 that includes functionality of cifs_convertUCSpath and does cleanup. Reported-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de> Acked-by: Steve French <sfrench@us.ibm.com> Acked-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--fs/cifs/misc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index 4c89c572891a..b2990b1d1975 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -691,14 +691,15 @@ cifs_convertUCSpath(char *target, const __le16 *source, int maxlen,
NLS_MAX_CHARSET_SIZE);
if (len > 0) {
j += len;
- continue;
+ goto overrun_chk;
} else {
target[j] = '?';
}
}
j++;
/* make sure we do not overrun callers allocated temp buffer */
- if (j >= (2 * NAME_MAX))
+overrun_chk:
+ if (j >= UNICODE_NAME_MAX)
break;
}
cUCS_out: