mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-03-11 19:06:38 -04:00
fixed a bug where unmap could be called with a NULL buffer
This commit is contained in:
10
rsync.c
10
rsync.c
@@ -486,8 +486,9 @@ int recv_files(int f_in,struct file_list *flist,char *local_name)
|
||||
char *buf;
|
||||
int i;
|
||||
|
||||
if (verbose > 2)
|
||||
if (verbose > 2) {
|
||||
fprintf(stderr,"recv_files(%d) starting\n",flist->count);
|
||||
}
|
||||
|
||||
if (recurse && delete_mode && !local_name && flist->count>0) {
|
||||
delete_files(flist);
|
||||
@@ -560,7 +561,10 @@ int recv_files(int f_in,struct file_list *flist,char *local_name)
|
||||
/* recv file data */
|
||||
receive_data(f_in,buf,fd2,fname);
|
||||
|
||||
if (fd1 != -1) close(fd1);
|
||||
if (fd1 != -1) {
|
||||
unmap_file(buf,st.st_size);
|
||||
close(fd1);
|
||||
}
|
||||
close(fd2);
|
||||
|
||||
if (verbose > 2)
|
||||
@@ -583,8 +587,6 @@ int recv_files(int f_in,struct file_list *flist,char *local_name)
|
||||
|
||||
cleanup_fname = NULL;
|
||||
|
||||
unmap_file(buf,st.st_size);
|
||||
|
||||
set_perms(fname,&flist->files[i],NULL,0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user