[gnome-software] Fix a crash in the profiling code when a PackageKit method is not supported



commit 47001bcdde13d5642d1ae46db65890c1fc2998bb
Author: Richard Hughes <richard hughsie com>
Date:   Thu Oct 29 16:09:55 2015 +0000

    Fix a crash in the profiling code when a PackageKit method is not supported
    
    In this case we go to FINISHED without ever doing SETUP, and so we never set up
    the task. Due to the helper struct being allocated on the stack means that it's
    not memset to zero and this means we try to dereference some random memory
    location. Crash!

 src/plugins/gs-plugin-packagekit-refine.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/gs-plugin-packagekit-refine.c b/src/plugins/gs-plugin-packagekit-refine.c
index 126a594..a815511 100644
--- a/src/plugins/gs-plugin-packagekit-refine.c
+++ b/src/plugins/gs-plugin-packagekit-refine.c
@@ -294,6 +294,7 @@ gs_plugin_packagekit_resolve_packages (GsPlugin *plugin,
        g_ptr_array_add (package_ids, NULL);
 
        data.plugin = plugin;
+       data.ptask = NULL;
 
        /* resolve them all at once */
        results = pk_client_resolve (plugin->priv->client,
@@ -342,6 +343,7 @@ gs_plugin_packagekit_refine_from_desktop (GsPlugin *plugin,
        g_autoptr(GPtrArray) packages = NULL;
 
        data.plugin = plugin;
+       data.ptask = NULL;
 
        to_array[0] = filename;
        results = pk_client_search_files (plugin->priv->client,
@@ -407,6 +409,7 @@ gs_plugin_packagekit_refine_updatedetails (GsPlugin *plugin,
        }
 
        data.plugin = plugin;
+       data.ptask = NULL;
 
        /* get any update details */
        results = pk_client_get_update_detail (plugin->priv->client,
@@ -551,6 +554,7 @@ gs_plugin_packagekit_refine_details (GsPlugin *plugin,
        g_ptr_array_add (package_ids, NULL);
 
        data.plugin = plugin;
+       data.ptask = NULL;
 
        /* get any details */
        results = pk_client_get_details (plugin->priv->client,
@@ -588,6 +592,7 @@ gs_plugin_packagekit_refine_update_severity (GsPlugin *plugin,
        g_autoptr(PkResults) results = NULL;
 
        data.plugin = plugin;
+       data.ptask = NULL;
 
        /* get the list of updates */
        filter = pk_bitfield_value (PK_FILTER_ENUM_NONE);
@@ -703,6 +708,7 @@ gs_plugin_packagekit_get_source_list (GsPlugin *plugin,
        g_autoptr(GPtrArray) array = NULL;
 
        data.plugin = plugin;
+       data.ptask = NULL;
 
        /* ask PK for the repo details */
        results = pk_client_get_repo_list (plugin->priv->client,


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