diff options
author | Steve French <sfrench@us.ibm.com> | 2005-08-02 21:31:05 -0700 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2005-08-02 21:31:05 -0700 |
commit | ef6724e32142c2d9ca252d423cacc435c142734e (patch) | |
tree | 5d002426e75eba4e2299b8bcc1f476c75ffb6cf2 /fs/cifs/cifssmb.c | |
parent | bcf7e34a71afe24dc210b7825f6f139774cb905c (diff) | |
download | linux-ef6724e32142c2d9ca252d423cacc435c142734e.tar.bz2 |
[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/cifs/cifssmb.c')
-rw-r--r-- | fs/cifs/cifssmb.c | 3 |
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; |