X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/82306bf6d644ceca9ef07b4989fb317fc8a613e5..c778aaa048494cdd7ef027c85a0cf57373da2a4d:/flist.c diff --git a/flist.c b/flist.c index 6b51ee29..c59d9340 100644 --- a/flist.c +++ b/flist.c @@ -373,14 +373,23 @@ static void send_directory(int f,struct file_list *flist,char *dir) fname[MAXPATHLEN-1]=0; l = strlen(fname); if (fname[l-1] != '/') { + if (l == MAXPATHLEN-1) { + fprintf(FERROR,"skipping long-named directory %s\n",fname); + closedir(d); + return; + } strcat(fname,"/"); l++; } p = fname + strlen(fname); if (cvs_exclude) { - strcpy(p,".cvsignore"); - local_exclude_list = make_exclude_list(fname,NULL,0); + if (strlen(fname) + strlen(".cvsignore") <= MAXPATHLEN-1) { + strcpy(p,".cvsignore"); + local_exclude_list = make_exclude_list(fname,NULL,0); + } else { + fprintf(FERROR,"cannot cvs-exclude in long-named directory %s\n",fname); + } } for (di=readdir(d); di; di=readdir(d)) { @@ -634,10 +643,9 @@ static void clean_fname(char *name) if (strncmp(p=name,"./",2) == 0) { modified = 1; - while (*p) { + do { p[0] = p[2]; - p++; - } + } while (*p++); } l = strlen(p=name);