From: Wayne Davison Date: Mon, 3 May 2004 01:18:07 +0000 (+0000) Subject: Fixed crash bug that can affect --delete in certain circumstances. X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/d508258ad81346389881c6b672e705103b3c762e Fixed crash bug that can affect --delete in certain circumstances. --- diff --git a/flist.c b/flist.c index b1a35381..7c39e538 100644 --- 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)