[evolution-ews] Add safety check when replacing folder hierarchy info in hash tables



commit fbc54a40cf328d56174eef1df7f3dc56553265f6
Author: Milan Crha <mcrha redhat com>
Date:   Wed Aug 19 19:06:39 2015 +0200

    Add safety check when replacing folder hierarchy info in hash tables
    
    Without it a crash could happen when the store's sync state was invalid
    for some reason and a fresh folder hierarchy discover was run.

 src/camel/camel-ews-store-summary.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/camel/camel-ews-store-summary.c b/src/camel/camel-ews-store-summary.c
index 413a40d..e672cd7 100644
--- a/src/camel/camel-ews-store-summary.c
+++ b/src/camel/camel-ews-store-summary.c
@@ -323,7 +323,7 @@ ews_ss_hash_replace (CamelEwsStoreSummary *ews_summary,
        if (ofname) {
                gchar *ofid = g_hash_table_lookup (
                        ews_summary->priv->fname_id_hash, ofname);
-               if (!strcmp (folder_id, ofid)) {
+               if (ofid && !strcmp (folder_id, ofid)) {
                        g_hash_table_remove (
                                ews_summary->priv->fname_id_hash, ofname);
                        if (recurse)


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