summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2005-08-02 21:31:05 -0700
committerSteve French <sfrench@us.ibm.com>2005-08-02 21:31:05 -0700
commitef6724e32142c2d9ca252d423cacc435c142734e (patch)
tree5d002426e75eba4e2299b8bcc1f476c75ffb6cf2 /fs
parentbcf7e34a71afe24dc210b7825f6f139774cb905c (diff)
downloadlwn-ef6724e32142c2d9ca252d423cacc435c142734e.tar.gz
lwn-ef6724e32142c2d9ca252d423cacc435c142734e.zip
[CIFS] Fix missing entries in search results when very long file names and
more than 50 (or so) of such long search entries in the directory. FindNext could send corrupt last byte of resume name when resume key was a few hundred bytes long file name or longer. Fixes Samba Bug # 2932 Signed-off-by: Steve French (sfrench@us.ibm.com)
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/cifssmb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index fbe651858c88..e555cb5cf493 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -2628,6 +2628,9 @@ int CIFSFindNext(const int xid, struct cifsTconInfo *tcon,
if(name_len < PATH_MAX) {
memcpy(pSMB->ResumeFileName, psrch_inf->presume_name, name_len);
byte_count += name_len;
+ /* 14 byte parm len above enough for 2 byte null terminator */
+ pSMB->ResumeFileName[name_len] = 0;
+ pSMB->ResumeFileName[name_len+1] = 0;
} else {
rc = -EINVAL;
goto FNext2_err_exit;