tracker/tracker-fix-segfault-in-writeback.patch
Dominique Leuenberger 102ee748fa Accepting request 781707 from home:AZhou:branches:GNOME:Factory
- Add tracker-fix-segfault-in-writeback.patch: Check if argument is
  NULL before using it and dispose connection and data_manager
  before shutting down writeback and events to prevent segmentation
  fault (bsc#1165357, glgo#GNOME/tracker!192).

OBS-URL: https://build.opensuse.org/request/show/781707
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/tracker?expand=0&rev=191
2020-03-07 21:56:31 +00:00

34 lines
946 B
Diff

diff --git a/src/tracker-store/tracker-main.vala b/src/tracker-store/tracker-main.vala
index 1e8d1ddd2..0db9b6653 100644
--- a/src/tracker-store/tracker-main.vala
+++ b/src/tracker-store/tracker-main.vala
@@ -368,12 +368,12 @@ License which can be viewed at:
message ("Cleaning up");
+ data_manager = null;
+ connection = null;
+
/* Shutdown major subsystems */
Tracker.Writeback.shutdown ();
Tracker.Events.shutdown ();
-
- data_manager = null;
- connection = null;
Tracker.DBus.shutdown ();
Tracker.Log.shutdown ();
diff --git a/src/tracker-store/tracker-writeback.c b/src/tracker-store/tracker-writeback.c
index 32517d553..fde45afc0 100644
--- a/src/tracker-store/tracker-writeback.c
+++ b/src/tracker-store/tracker-writeback.c
@@ -200,6 +200,8 @@ tracker_writeback_transact (void)
GHashTableIter iter;
gpointer key, value;
+ g_return_if_fail (private == NULL);
+
if (!private->pending_events)
return;