Browse Source

Avoid a crash if realloc returns a different pointer.

Signed-off-by: Junio C Hamano <junkio@cox.net>
maint
Mike McCormack 19 years ago committed by Junio C Hamano
parent
commit
34c5a9e284
  1. 1
      imap-send.c

1
imap-send.c

@ -1202,6 +1202,7 @@ read_message( FILE *f, msg_data_t *msg ) @@ -1202,6 +1202,7 @@ read_message( FILE *f, msg_data_t *msg )
p = xrealloc(msg->data, len+1);
if (!p)
break;
msg->data = p;
}
r = fread( &msg->data[msg->len], 1, len - msg->len, f );
if (r <= 0)

Loading…
Cancel
Save