--- rsync-3.0.7/flist.c.orig 2010-03-24 14:32:53.000000000 +0100 +++ rsync-3.0.7/flist.c 2010-03-24 14:38:55.000000000 +0100 @@ -1641,7 +1641,14 @@ static void send_directory(int f, struct p = fbuf + len; if (len != 1 || *fbuf != '/') + { + if (len >= MAXPATHLEN-1) + { + rprintf(FERROR_XFER, "Directory path too long\n"); + return; + } *p++ = '/'; + } *p = '\0'; remainder = MAXPATHLEN - (p - fbuf);