From: Wayne Davison Date: Mon, 9 Jan 2023 05:35:39 +0000 (-0800) Subject: Don't call memcmp() on an empty lastdir. X-Git-Tag: v3.3.0pre1~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=90df93e446f9ebbfd4ce97d6755c5fe1f45f9fd0;p=thirdparty%2Frsync.git Don't call memcmp() on an empty lastdir. --- diff --git a/flist.c b/flist.c index 65b459b1..4eb672f1 100644 --- a/flist.c +++ b/flist.c @@ -2367,7 +2367,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[]) } dirlen = dir ? strlen(dir) : 0; - if (dirlen != lastdir_len || memcmp(lastdir, dir, dirlen) != 0) { + if (dirlen != lastdir_len || (dirlen && memcmp(lastdir, dir, dirlen) != 0)) { if (!change_pathname(NULL, dir, -dirlen)) goto bad_path; lastdir = pathname;