X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/9784f01cbc4cc2cd7d08116ac44a30ca7ee27b27..44ae54114ac29ebe6bff34f98e59e51d3cb71a40:/flist.c diff --git a/flist.c b/flist.c index 3e79ce10..0fc7851a 100644 --- a/flist.c +++ b/flist.c @@ -1385,6 +1385,14 @@ static struct file_struct *send_file_name(int f, struct file_list *flist, if (preserve_links && S_ISLNK(file->mode)) { symlink_name = F_SYMLINK(file); symlink_len = strlen(symlink_name); + if (symlink_len == 0) { + io_error |= IOERR_GENERAL; + f_name(file, fbuf); + rprintf(FERROR_XFER, + "skipping symlink with 0-length value: %s\n", + full_fname(fbuf)); + return NULL; + } } else { symlink_name = NULL; symlink_len = 0; @@ -2254,6 +2262,8 @@ struct file_list *send_file_list(int f, int argc, char *argv[]) if (numeric_ids <= 0 && !inc_recurse) send_id_list(f); + set_msg_fd_in(-1); + /* send the io_error flag */ if (protocol_version < 30) write_int(f, ignore_errors ? 0 : io_error);