public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Mike McCormack <mike@codeweavers•com>
To: git@vger•kernel.org
Subject: [PATCH] Avoid a crash if realloc returns a different pointer.
Date: Wed, 05 Apr 2006 23:22:19 +0900	[thread overview]
Message-ID: <4433D29B.1080802@codeweavers.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 80 bytes --]

---

  imap-send.c |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)


[-- Attachment #2: 235cf581a853777fdb6886806ddbfcd9f782eb98.diff --]
[-- Type: text/x-patch, Size: 369 bytes --]

235cf581a853777fdb6886806ddbfcd9f782eb98
diff --git a/imap-send.c b/imap-send.c
index f3cb79b..d04259a 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -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)


                 reply	other threads:[~2006-04-05 14:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4433D29B.1080802@codeweavers.com \
    --to=mike@codeweavers$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox