Skip to content

Commit

Permalink
Avoid a crash if realloc returns a different pointer.
Browse files Browse the repository at this point in the history
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Mike McCormack authored and Junio C Hamano committed Apr 5, 2006
1 parent 1cd88cc commit 34c5a9e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions imap-send.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 34c5a9e

Please sign in to comment.