From 613b4a4b5c420cbb45e35e3251f00258b02fb0f8 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Sat, 27 Jan 2001 20:19:21 +0000 Subject: Protect against NULL address pointers. (subject_compare): Same but for 2001-01-27 Jeffrey Stedfast * message-list.c (address_compare): Protect against NULL address pointers. (subject_compare): Same but for subject pointers. svn path=/trunk/; revision=7863 --- mail/ChangeLog | 6 ++++++ mail/message-list.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/mail/ChangeLog b/mail/ChangeLog index 165ddfa3a8..c92502803c 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,9 @@ +2001-01-27 Jeffrey Stedfast + + * message-list.c (address_compare): Protect against NULL address + pointers. + (subject_compare): Same but for subject pointers. + 2001-01-27 Iain Holmes * mail-summary.c (create_summary_view): Applied patch from John R Sheets diff --git a/mail/message-list.c b/mail/message-list.c index 9ce7d18aef..44d82c63f7 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -255,6 +255,9 @@ address_compare (gconstpointer address1, gconstpointer address2) EMailAddress *addr1, *addr2; gint retval; + g_return_val_if_fail (address1 != NULL, 1); + g_return_val_if_fail (address2 != NULL, -1); + addr1 = e_mail_address_new (address1); addr2 = e_mail_address_new (address2); retval = e_mail_address_compare (addr1, addr2); @@ -270,6 +273,9 @@ subject_compare (gconstpointer subject1, gconstpointer subject2) char *sub1; char *sub2; + g_return_val_if_fail (subject1 != NULL, 1); + g_return_val_if_fail (subject2 != NULL, -1); + /* trim off any "Re:"'s at the beginning of subject1 */ sub1 = (char *) subject1; while (!g_strncasecmp (sub1, "Re:", 3)) { -- cgit