[evolution] pine-importer: Fix a crash when importing with no existing address books
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] pine-importer: Fix a crash when importing with no existing address books
- Date: Wed, 4 Dec 2013 13:31:02 +0000 (UTC)
commit 7cb2ed6c67b09ca0f2ece3ca4d56b60e97b5ac6f
Author: Philip Withnall <philip withnall collabora co uk>
Date: Fri Nov 29 11:20:32 2013 +0000
pine-importer: Fix a crash when importing with no existing address books
This is a theoretical crash (not actually reproduced), caused by the
client variable being NULL if no address books exist. Instead of
crashing, gracefully exit with an error.
Found by scan-build.
https://bugzilla.gnome.org/719540
mail/importers/pine-importer.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/mail/importers/pine-importer.c b/mail/importers/pine-importer.c
index f5ae3fd..fe63620 100644
--- a/mail/importers/pine-importer.c
+++ b/mail/importers/pine-importer.c
@@ -198,6 +198,11 @@ import_contacts (void)
source = E_SOURCE (list->data);
client = e_book_client_connect_sync (source, NULL, &error);
+ } else {
+ /* No address books exist. */
+ g_warning ("%s: No address books exist.", G_STRFUNC);
+ fclose (fp);
+ return;
}
g_list_free_full (list, (GDestroyNotify) g_object_unref);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]