X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/6ba9279fb2c52280cedaaca94783caf44ae9d324..dd04a03440be7c04ec7c3005d5fd92ec03311358:/flist.c diff --git a/flist.c b/flist.c index 0a61d344..3e3b3a68 100644 --- a/flist.c +++ b/flist.c @@ -251,8 +251,10 @@ void receive_file_entry(struct file_struct **fptr, bzero((char *)file,sizeof(*file)); (*fptr) = file; + if (l2 >= MAXPATHLEN-l1) overflow("receive_file_entry"); + strncpy(thisname,lastname,l1); - read_buf(f,&thisname[l1],l2); + read_sbuf(f,&thisname[l1],l2); thisname[l1+l2] = 0; strncpy(lastname,thisname,MAXPATHLEN-1); @@ -292,8 +294,7 @@ void receive_file_entry(struct file_struct **fptr, int l = read_int(f); file->link = (char *)malloc(l+1); if (!file->link) out_of_memory("receive_file_entry 2"); - read_buf(f,file->link,l); - file->link[l] = 0; + read_sbuf(f,file->link,l); } #if SUPPORT_HARD_LINKS @@ -669,6 +670,9 @@ struct file_list *send_file_list(int f,int argc,char *argv[]) write_int(f, io_error); } + if (verbose > 2) + fprintf(FINFO,"send_file_list done\n"); + return flist; } @@ -741,6 +745,9 @@ struct file_list *recv_file_list(int f) io_error |= read_int(f); } + if (verbose > 2) + fprintf(FINFO,"recv_file_list done\n"); + return flist; oom: