From c55f70218c2f5f292bdef2bb6ecb16408eb35f44 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 24 Jan 2000 11:41:08 +0000 Subject: [PATCH] fixed a rare SEGV that can happen when a file disappears (due to another program) during an update --- receiver.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/receiver.c b/receiver.c index 6647c68a..bf0877b3 100644 --- a/receiver.c +++ b/receiver.c @@ -254,10 +254,12 @@ static int receive_data(int f_in,struct map_struct *buf,int fd,char *fname, rprintf(FINFO,"chunk[%d] of size %d at %.0f offset=%.0f\n", i,len,(double)offset2,(double)offset); - map = map_ptr(buf,offset2,len); + if (buf) { + map = map_ptr(buf,offset2,len); - see_token(map, len); - sum_update(map,len); + see_token(map, len); + sum_update(map,len); + } if (fd != -1 && write_file(fd,map,len) != len) { rprintf(FERROR,"write failed on %s : %s\n", -- 2.34.1