Fixed crash bug that can affect --delete in certain circumstances.
authorWayne Davison <wayned@samba.org>
Mon, 3 May 2004 01:18:07 +0000 (01:18 +0000)
committerWayne Davison <wayned@samba.org>
Mon, 3 May 2004 01:18:07 +0000 (01:18 +0000)
flist.c

diff --git a/flist.c b/flist.c
index b1a3538..7c39e53 100644 (file)
--- a/flist.c
+++ b/flist.c
@@ -542,6 +542,9 @@ void receive_file_entry(struct file_struct **fptr, unsigned short flags,
                return;
        }
 
+       if (!flist || !flist->count)    /* Ignore lastdir when invalid. */
+               lastdir_len = -1;
+
        if (flags & XMIT_SAME_NAME)
                l1 = read_byte(f);
 
@@ -745,7 +748,7 @@ struct file_struct *make_file(char *fname,
        char *basename, *dirname, *bp;
        unsigned short flags = 0;
 
-       if (!flist)     /* lastdir isn't valid if flist is NULL */
+       if (!flist || !flist->count)    /* Ignore lastdir when invalid. */
                lastdir_len = -1;
 
        if (strlcpy(thisname, fname, sizeof thisname)