Skip to content

Commit d024709

Browse files
Steve FrenchLinus Torvalds
authored andcommitted
[PATCH] CIFS: Fix missing entries in search results
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) Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent 1b0a74d commit d024709

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎fs/cifs/cifssmb.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2602,6 +2602,9 @@ int CIFSFindNext(const int xid, struct cifsTconInfo *tcon,
26022602
if(name_len < PATH_MAX) {
26032603
memcpy(pSMB->ResumeFileName, psrch_inf->presume_name, name_len);
26042604
byte_count += name_len;
2605+
/* 14 byte parm len above enough for 2 byte null terminator */
2606+
pSMB->ResumeFileName[name_len] = 0;
2607+
pSMB->ResumeFileName[name_len+1] = 0;
26052608
} else {
26062609
rc = -EINVAL;
26072610
goto FNext2_err_exit;

0 commit comments

Comments
 (0)