Skip to content

Commit

Permalink
[CIFS] Fix missing entries in search results when very long file name…
Browse files Browse the repository at this point in the history
…s 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)
  • Loading branch information
Steve French committed Aug 3, 2005
1 parent bcf7e34 commit ef6724e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/cifs/cifssmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ef6724e

Please sign in to comment.