diff options
author | Vivek Jain <jvivek@novell.com> | 2005-07-28 17:41:23 +0800 |
---|---|---|
committer | Jain Vivek <jvivek@src.gnome.org> | 2005-07-28 17:41:23 +0800 |
commit | 76a33be1100b2711f9ab41aedfabc7c4279d60a0 (patch) | |
tree | 577fb8e74cb5c2a59820fce8264622e14217bea9 | |
parent | a6ec3a48d876168e706a7cae3099611dd56fc8d7 (diff) | |
download | gsoc2013-evolution-76a33be1100b2711f9ab41aedfabc7c4279d60a0.tar gsoc2013-evolution-76a33be1100b2711f9ab41aedfabc7c4279d60a0.tar.gz gsoc2013-evolution-76a33be1100b2711f9ab41aedfabc7c4279d60a0.tar.bz2 gsoc2013-evolution-76a33be1100b2711f9ab41aedfabc7c4279d60a0.tar.lz gsoc2013-evolution-76a33be1100b2711f9ab41aedfabc7c4279d60a0.tar.xz gsoc2013-evolution-76a33be1100b2711f9ab41aedfabc7c4279d60a0.tar.zst gsoc2013-evolution-76a33be1100b2711f9ab41aedfabc7c4279d60a0.zip |
check for NULL before using the address. **Fixes bugs like #274544
2005-07-28 Vivek Jain <jvivek@novell.com>
* bbdb.c:(bbdb_handle_reply):check for NULL
before using the address.
**Fixes bugs like #274544
svn path=/trunk/; revision=29913
-rw-r--r-- | plugins/bbdb/ChangeLog | 6 | ||||
-rw-r--r-- | plugins/bbdb/bbdb.c | 36 |
2 files changed, 27 insertions, 15 deletions
diff --git a/plugins/bbdb/ChangeLog b/plugins/bbdb/ChangeLog index a22f7faae0..5def505a3e 100644 --- a/plugins/bbdb/ChangeLog +++ b/plugins/bbdb/ChangeLog @@ -1,3 +1,9 @@ +2005-07-28 Vivek Jain <jvivek@novell.com> + + * bbdb.c:(bbdb_handle_reply):check for NULL + before using the address. + **Fixes bugs like #274544 + 2005-05-11 Not Zed <NotZed@Ximian.com> * Makefile.am: setup cleanfiles/built_sources diff --git a/plugins/bbdb/bbdb.c b/plugins/bbdb/bbdb.c index c8dcaf7edb..7ac34375f6 100644 --- a/plugins/bbdb/bbdb.c +++ b/plugins/bbdb/bbdb.c @@ -115,11 +115,13 @@ bbdb_handle_reply (EPlugin *ep, EMEventTargetMessage *target) return; cia = camel_mime_message_get_from (target->message); - for (i = 0; i < camel_address_length (CAMEL_ADDRESS (cia)); i ++) { - const char *name=NULL, *email=NULL; - if (!(camel_internet_address_get (cia, i, &name, &email))) - continue; - bbdb_do_it (book, name, email); + if (cia) { + for (i = 0; i < camel_address_length (CAMEL_ADDRESS (cia)); i ++) { + const char *name=NULL, *email=NULL; + if (!(camel_internet_address_get (cia, i, &name, &email))) + continue; + bbdb_do_it (book, name, email); + } } /* If this is a reply-all event, process To: and Cc: also. */ @@ -129,19 +131,23 @@ bbdb_handle_reply (EPlugin *ep, EMEventTargetMessage *target) } cia = camel_mime_message_get_recipients (target->message, CAMEL_RECIPIENT_TYPE_TO); - for (i = 0; i < camel_address_length (CAMEL_ADDRESS (cia)); i ++) { - const char *name=NULL, *email=NULL; - if (!(camel_internet_address_get (cia, i, &name, &email))) - continue; - bbdb_do_it (book, name, email); + if (cia) { + for (i = 0; i < camel_address_length (CAMEL_ADDRESS (cia)); i ++) { + const char *name=NULL, *email=NULL; + if (!(camel_internet_address_get (cia, i, &name, &email))) + continue; + bbdb_do_it (book, name, email); + } } cia = camel_mime_message_get_recipients (target->message, CAMEL_RECIPIENT_TYPE_CC); - for (i = 0; i < camel_address_length (CAMEL_ADDRESS (cia)); i ++) { - const char *name=NULL, *email=NULL; - if (!(camel_internet_address_get (cia, i, &name, &email))) - continue; - bbdb_do_it (book, name, email); + if (cia) { + for (i = 0; i < camel_address_length (CAMEL_ADDRESS (cia)); i ++) { + const char *name=NULL, *email=NULL; + if (!(camel_internet_address_get (cia, i, &name, &email))) + continue; + bbdb_do_it (book, name, email); + } } g_object_unref (G_OBJECT (book)); |