From 6e8061371776c0716b9eab43c04c48a338cf726a Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Wed, 4 Feb 2009 07:53:35 -0800 Subject: [PATCH] Do not try to send a symlink with a 0-length value. This avoids a transfer error in the receiver. --- flist.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/flist.c b/flist.c index 3e79ce10..1fa2cac8 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; -- 2.34.1