X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/fc4e8d51ff374d442de010c2a7d3b55b57248d86..575f2fca9ab74cb30cca67323a414d7b0cdd0845:/flist.c diff --git a/flist.c b/flist.c index f6f2c99f..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