Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Steve French and committed by
Linus Torvalds
d024709d 1b0a74d1

+3
+3
fs/cifs/cifssmb.c
··· 2602 2602 if(name_len < PATH_MAX) { 2603 2603 memcpy(pSMB->ResumeFileName, psrch_inf->presume_name, name_len); 2604 2604 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; 2605 2608 } else { 2606 2609 rc = -EINVAL; 2607 2610 goto FNext2_err_exit;