[notmuch] [PATCH] notmuch-reply.c: early exit for munged Reply-To when header is not present

Subject: [notmuch] [PATCH] notmuch-reply.c: early exit for munged Reply-To when header is not present

Date: Mon, 30 Nov 2009 14:21:17 +0100

To: cworth@cworth.org

Cc: notmuch@notmuchmail.org

From: Jed Brown


This avoids erroneously calling internet_address_list_length() with a
NULL list (which was causing a gmime exception).

Signed-off-by: Jed Brown <jed@59A2.org>
---
 notmuch-reply.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/notmuch-reply.c b/notmuch-reply.c
index 9b9e9ab..6c9118e 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -202,7 +202,7 @@ mailing_list_munged_reply_to (notmuch_message_t *message)
 
     header = notmuch_message_get_header (message, "reply-to");
     list = internet_address_list_parse_string (header);
-    if (internet_address_list_length (list) != 1)
+    if (list == NULL || internet_address_list_length (list) != 1)
 	return 0;
     address = internet_address_list_get_address (list, 0);
     if (INTERNET_ADDRESS_IS_GROUP (address))
-- 
1.6.5.3


Thread: