tree c383ee45809d28079b4dcd554f9953509c57da1b
parent 1b0a74d1c002320d5488333dd9c72126af1aab02
author Steve French <[EMAIL PROTECTED]> Mon, 15 Aug 2005 02:55:23 -0500
committer Linus Torvalds <[EMAIL PROTECTED]> Mon, 15 Aug 2005 05:27:24 -0700

[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 ([EMAIL PROTECTED])
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 fs/cifs/cifssmb.c |    3 +++
 1 files changed, 3 insertions(+)

diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -2602,6 +2602,9 @@ int CIFSFindNext(const int xid, struct c
        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;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to