X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/d6dead6bb15edc672b188bc2941ab02744a899bb..1a016bfdec2823c6d4e78a3dcc253cdfc30a10af:/flist.c diff --git a/flist.c b/flist.c index d7da6e88..cf401519 100644 --- a/flist.c +++ b/flist.c @@ -521,7 +521,7 @@ static void send_directory(int f,struct file_list *flist,char *dir) closedir(d); return; } - strcat(fname,"/"); + strlcat(fname,"/", MAXPATHLEN-1); l++; } p = fname + strlen(fname); @@ -585,7 +585,7 @@ struct file_list *send_file_list(int f,int argc,char *argv[]) l = strlen(fname); if (l != 1 && fname[l-1] == '/') { - strcat(fname,"."); + strlcat(fname,".",MAXPATHLEN-1); } if (link_stat(fname,&st) != 0) { @@ -616,7 +616,7 @@ struct file_list *send_file_list(int f,int argc,char *argv[]) thus getting their permissions right */ *p = 0; if (strcmp(lastpath,fname)) { - strcpy(lastpath, fname); + strlcpy(lastpath, fname, sizeof(lastpath)-1); *p = '/'; for (p=fname+1; (p=strchr(p,'/')); p++) { *p = 0; @@ -878,7 +878,7 @@ char *f_name(struct file_struct *f) n = (n+1)%10; if (f->dirname) { - sprintf(p, "%s/%s", f->dirname, f->basename); + slprintf(p, MAXPATHLEN-1, "%s/%s", f->dirname, f->basename); } else { strlcpy(p, f->basename, MAXPATHLEN-1); }