diff options
author | Steve French <sfrench@us.ibm.com> | 2005-08-03 00:31:05 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2005-08-03 00:31:05 -0400 |
commit | ef6724e32142c2d9ca252d423cacc435c142734e (patch) | |
tree | 5d002426e75eba4e2299b8bcc1f476c75ffb6cf2 /fs/cifs/cifssmb.c | |
parent | bcf7e34a71afe24dc210b7825f6f139774cb905c (diff) |
[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, | |||
2628 | if(name_len < PATH_MAX) { | 2628 | if(name_len < PATH_MAX) { |
2629 | memcpy(pSMB->ResumeFileName, psrch_inf->presume_name, name_len); | 2629 | memcpy(pSMB->ResumeFileName, psrch_inf->presume_name, name_len); |
2630 | byte_count += name_len; | 2630 | byte_count += name_len; |
2631 | /* 14 byte parm len above enough for 2 byte null terminator */ | ||
2632 | pSMB->ResumeFileName[name_len] = 0; | ||
2633 | pSMB->ResumeFileName[name_len+1] = 0; | ||
2631 | } else { | 2634 | } else { |
2632 | rc = -EINVAL; | 2635 | rc = -EINVAL; |
2633 | goto FNext2_err_exit; | 2636 | goto FNext2_err_exit; |