Blame SOURCES/crash-when-run-as-root.patch

fa3848
From 98dbef8b5a547d3d920d377022e20d2e63519b2f Mon Sep 17 00:00:00 2001
fa3848
From: Milan Crha <mcrha@redhat.com>
fa3848
Date: Tue, 16 Feb 2021 12:58:19 +0100
fa3848
Subject: [PATCH 1/2] GsApplication: Crash when run as root
fa3848
fa3848
The `search_provider` is not initialized in this case, leading
fa3848
to NULL dereference. Skip the call in such cases, because the search
fa3848
provider is not that important.
fa3848
fa3848
Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1142
fa3848
---
fa3848
 src/gs-application.c | 3 ++-
fa3848
 1 file changed, 2 insertions(+), 1 deletion(-)
fa3848
fa3848
diff --git a/src/gs-application.c b/src/gs-application.c
fa3848
index 48f0c6aac..fdb5f55c4 100644
fa3848
--- a/src/gs-application.c
fa3848
+++ b/src/gs-application.c
fa3848
@@ -912,7 +912,8 @@ static void
fa3848
 gs_application_setup_search_provider (GsApplication *app)
fa3848
 {
fa3848
 	gs_application_initialize_plugins (app);
fa3848
-	gs_shell_search_provider_setup (app->search_provider, app->plugin_loader);
fa3848
+	if (app->search_provider)
fa3848
+		gs_shell_search_provider_setup (app->search_provider, app->plugin_loader);
fa3848
 }
fa3848
 
fa3848
 static void
fa3848
-- 
fa3848
GitLab
fa3848
fa3848
fa3848
From 0055bfa8535bb7c5ccd9ace244d71b2885a47daa Mon Sep 17 00:00:00 2001
fa3848
From: Philip Withnall <philip@tecnocode.co.uk>
fa3848
Date: Mon, 22 Feb 2021 11:41:05 +0000
fa3848
Subject: [PATCH 2/2] Apply 1 suggestion(s) to 1 file(s)
fa3848
fa3848
---
fa3848
 src/gs-application.c | 2 +-
fa3848
 1 file changed, 1 insertion(+), 1 deletion(-)
fa3848
fa3848
diff --git a/src/gs-application.c b/src/gs-application.c
fa3848
index fdb5f55c4..f05f6f718 100644
fa3848
--- a/src/gs-application.c
fa3848
+++ b/src/gs-application.c
fa3848
@@ -49,7 +49,7 @@ struct _GsApplication {
fa3848
 #ifdef HAVE_PACKAGEKIT
fa3848
 	GsDbusHelper	*dbus_helper;
fa3848
 #endif
fa3848
-	GsShellSearchProvider *search_provider;
fa3848
+	GsShellSearchProvider *search_provider;  /* (nullable) (owned) */
fa3848
 	GSettings       *settings;
fa3848
 	GSimpleActionGroup	*action_map;
fa3848
 	guint		 shell_loaded_handler_id;
fa3848
-- 
fa3848
GitLab
fa3848