[gnome-software] Fixes a potential crash when parsing AppStream files



commit 719baa81154de444a26a97dea8cb8e216ff2a5bb
Author: Richard Hughes <richard hughsie com>
Date:   Thu Dec 1 18:38:38 2016 +0000

    Fixes a potential crash when parsing AppStream files
    
    Resolves: 
https://retrace.fedoraproject.org/faf/problems/bthash/?bth=0a1f2a9d4b0139665374680be64481ee48a1707a

 src/plugins/gs-appstream.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/plugins/gs-appstream.c b/src/plugins/gs-appstream.c
index 075a5b6..8aed042 100644
--- a/src/plugins/gs-appstream.c
+++ b/src/plugins/gs-appstream.c
@@ -644,9 +644,11 @@ gs_appstream_refine_app (GsPlugin *plugin,
        if (as_app_get_origin (item) != NULL &&
            gs_app_get_origin (app) == NULL ) {
                tmp = as_app_get_unique_id (item);
-               if (g_str_has_prefix (tmp, "user/flatpak/") ||
-                   g_str_has_prefix (tmp, "system/flatpak/"))
-                       gs_app_set_origin (app, as_app_get_origin (item));
+               if (tmp != NULL) {
+                       if (g_str_has_prefix (tmp, "user/flatpak/") ||
+                           g_str_has_prefix (tmp, "system/flatpak/"))
+                               gs_app_set_origin (app, as_app_get_origin (item));
+               }
        }
 
        /* set description */


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