[evolution-data-server/gnome-3-26] [IMAPx] Prevent crash in imapx_update_store_summary()



commit ac9fbe65cd19f1465157668e1c09e0baa362e00a
Author: Milan Crha <mcrha redhat com>
Date:   Tue Oct 10 10:18:34 2017 +0200

    [IMAPx] Prevent crash in imapx_update_store_summary()
    
    The change prevents crash when the folder's parent store is freeing or freed,
    in which case the camel_folder_get_parent_store() returns NULL, but it was not
    checked for this case in the function, it dereferenced the NULL pointer instead.
    
    It had been reported downstream at:
    https://bugzilla.redhat.com/show_bug.cgi?id=1499775

 src/camel/providers/imapx/camel-imapx-utils.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/camel/providers/imapx/camel-imapx-utils.c b/src/camel/providers/imapx/camel-imapx-utils.c
index ae5b7cf..82648ed 100644
--- a/src/camel/providers/imapx/camel-imapx-utils.c
+++ b/src/camel/providers/imapx/camel-imapx-utils.c
@@ -404,6 +404,9 @@ imapx_update_store_summary (CamelFolder *folder)
        full_name = camel_folder_get_full_name (folder);
        parent_store = camel_folder_get_parent_store (folder);
 
+       if (!parent_store)
+               return;
+
        imapx_store = CAMEL_IMAPX_STORE (parent_store);
 
        si = camel_store_summary_path (imapx_store->summary, full_name);


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