unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
To: notmuch@notmuchmail.org
Subject: [PATCH 1/3] Fix double free in guess_from_received_header().
Date: Wed, 15 Jun 2011 15:12:12 +0400	[thread overview]
Message-ID: <1308136334-9219-1-git-send-email-dmitry.kurochkin@gmail.com> (raw)

Before the change, the last loop in guess_from_received_header()
did not reset domain and tld variables to NULL.  This leads to
double free error in some cases and possibly other bugs.
---
 notmuch-reply.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/notmuch-reply.c b/notmuch-reply.c
index 514bbc6..dab69e6 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -406,6 +406,7 @@ guess_from_received_header (notmuch_config_t *config, notmuch_message_t *message
 	/* Now extract the last two components of the MTA host name
 	 * as domain and tld.
 	 */
+	domain = tld = NULL;
 	while ((ptr = strsep (&token, delim)) != NULL) {
 	    if (*ptr == '\0')
 		continue;
-- 
1.7.5.4

             reply	other threads:[~2011-06-15 11:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-15 11:12 Dmitry Kurochkin [this message]
2011-06-15 11:12 ` [PATCH 2/3] Fix memory leak in guess_from_received_header() Dmitry Kurochkin
2011-06-15 11:12 ` [PATCH 3/3] Fix indentation " Dmitry Kurochkin
2011-06-15 14:08 ` [PATCH 1/3] Fix double free " Carl Worth

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

  List information: https://notmuchmail.org/

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

  git send-email \
    --in-reply-to=1308136334-9219-1-git-send-email-dmitry.kurochkin@gmail.com \
    --to=dmitry.kurochkin@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).