[balsa] Do not pass NULL list to internet_address_list_to_string



commit 99f6cd79695e12a079678202c47570701e2970f4
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Mon Dec 7 11:11:21 2009 -0500

    Do not pass NULL list to internet_address_list_to_string

 ChangeLog         |    5 +++++
 libbalsa/filter.c |    6 ++++--
 2 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index e563296..11e8541 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-12-07  Peter Bloomfield
+
+	* libbalsa/filter.c (libbalsa_condition_matches): do not pass
+	NULL list to internet_address_list_to_string().
+
 2009-12-06  Pawel Salek
 
 	* configure.in
diff --git a/libbalsa/filter.c b/libbalsa/filter.c
index 7c0f6bd..450fab6 100644
--- a/libbalsa/filter.c
+++ b/libbalsa/filter.c
@@ -132,7 +132,8 @@ libbalsa_condition_matches(LibBalsaCondition* cond,
             }
         }
         /* do the work */
-	if (CONDITION_CHKMATCH(cond,CONDITION_MATCH_TO)) {
+	if (CONDITION_CHKMATCH(cond,CONDITION_MATCH_TO)
+            && message->headers->to_list) {
             str =
                 internet_address_list_to_string(message->headers->to_list,
                                                 FALSE);
@@ -156,7 +157,8 @@ libbalsa_condition_matches(LibBalsaCondition* cond,
                 break;
             }
 	}
-	if (CONDITION_CHKMATCH(cond,CONDITION_MATCH_CC)) {
+	if (CONDITION_CHKMATCH(cond,CONDITION_MATCH_CC)
+            && message->headers->cc_list) {
             str =
                 internet_address_list_to_string(message->headers->cc_list,
                                                 FALSE);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]