[evolution-data-server] Bug 708016 - CamelIMAPXStore: Crash when no namespace info present



commit 848c97de69411dfdbef2c8c8371e8f7bff9aa87a
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sat Sep 14 13:15:43 2013 -0400

    Bug 708016 - CamelIMAPXStore: Crash when no namespace info present

 camel/camel-imapx-store.c |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/camel/camel-imapx-store.c b/camel/camel-imapx-store.c
index c63676e..339a0f0 100644
--- a/camel/camel-imapx-store.c
+++ b/camel/camel-imapx-store.c
@@ -979,6 +979,8 @@ get_folder_info_offline (CamelStore *store,
 
        /* get starting point */
        if (top[0] == 0) {
+               CamelIMAPXNamespaceList *namespace_list;
+               gboolean have_personal_prefix;
                gchar *namespace = NULL;
 
                if (use_namespace) {
@@ -990,11 +992,19 @@ get_folder_info_offline (CamelStore *store,
                        g_object_unref (settings);
                }
 
-               if (namespace != NULL) {
-                       name = g_strdup (imapx_store->summary->namespaces->personal->prefix);
-                       top = imapx_store->summary->namespaces->personal->prefix;
-               } else
+               namespace_list = imapx_store->summary->namespaces;
+
+               have_personal_prefix =
+                       (namespace_list != NULL) &&
+                       (namespace_list->personal != NULL) &&
+                       (namespace_list->personal->prefix != NULL);
+
+               if (namespace != NULL && have_personal_prefix) {
+                       name = g_strdup (namespace_list->personal->prefix);
+                       top = namespace_list->personal->prefix;
+               } else {
                        name = g_strdup ("");
+               }
 
                g_free (namespace);
        } else {


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