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

Jed Brown jed at 59A2.org
Mon Nov 30 05:21:17 PST 2009


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

Signed-off-by: Jed Brown <jed at 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



More information about the notmuch mailing list