[grilo-plugins] tracker: fix use after free of GrlTrackerSource



commit 7c6d3882a32b7cc290c435b962264d70fcb30684
Author: Victor Toso <me victortoso com>
Date:   Thu Aug 25 14:10:32 2016 +0200

    tracker: fix use after free of GrlTrackerSource
    
    grl_registry_register_source() takes ownership of GrlSource and we
    were not considering it. Increasing reference for Grilo API.
    
    Backtrace:
     #0  0x00007fffbb390571 in notify_change (self=0x17ac8a0 [GrlTrackerSourceNotify], id=104136, 
change_type=GRL_CONTENT_CHANGED)
         at grl-tracker-source-notif.c:120
     #1  0x00007fffbb3907a1 in update_query_done (self=0x17ac8a0 [GrlTrackerSourceNotify]) at 
grl-tracker-source-notif.c:159
     #2  0x00007fffbb39088e in update_cursor_next_cb (source_object=0x7fffc00109a0 [TrackerDBCursor], 
result=0x7fffcf7e75c0, user_data=0x17ac8a0)
         at grl-tracker-source-notif.c:183
     #3  0x00007ffff47aeb43 in g_task_return_now (task=0x7fffcf7e75c0 [GTask]) at 
/build/glib2.0-wnDt2X/glib2.0-2.48.1/./gio/gtask.c:1107
     #4  0x00007ffff47aeb79 in complete_in_idle_cb (task=0x7fffcf7e75c0) at 
/build/glib2.0-wnDt2X/glib2.0-2.48.1/./gio/gtask.c:1121
     #5  0x00007ffff35b905a in g_main_context_dispatch (context=0x623730) at 
/build/glib2.0-wnDt2X/glib2.0-2.48.1/./glib/gmain.c:3154
     #6  0x00007ffff35b905a in g_main_context_dispatch (context=context@entry=0x623730) at 
/build/glib2.0-wnDt2X/glib2.0-2.48.1/./glib/gmain.c:3769
     #7  0x00007ffff35b9400 in g_main_context_iterate (context=context@entry=0x623730, block=block@entry=1, 
dispatch=dispatch@entry=1, self=<optimized out>) at
         /build/glib2.0-wnDt2X/glib2.0-2.48.1/./glib/gmain.c:3840
     #8  0x00007ffff35b94ac in g_main_context_iteration (context=context@entry=0x623730, 
may_block=may_block@entry=1)
         at /build/glib2.0-wnDt2X/glib2.0-2.48.1/./glib/gmain.c:3901
     #9  0x00007ffff47d4cdd in g_application_run (application=0x62c180 [RBApplication], argc=1, 
argv=0x7fffffffde18)
         at /build/glib2.0-wnDt2X/glib2.0-2.48.1/./gio/gapplication.c:2381
     #10 0x00007ffff7acf515 in rb_application_run () at /usr/lib/librhythmbox-core.so.9
     #11 0x0000000000400eba in main ()
    
    Reported-by: Alberto Garcia <berto igalia com>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=767684

 src/tracker/grl-tracker-source.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/tracker/grl-tracker-source.c b/src/tracker/grl-tracker-source.c
index 4f01580..4ee4b39 100644
--- a/src/tracker/grl-tracker-source.c
+++ b/src/tracker/grl-tracker-source.c
@@ -232,7 +232,7 @@ grl_tracker_add_source (GrlTrackerSource *source)
     priv->state = GRL_TRACKER_SOURCE_STATE_RUNNING;
     grl_registry_register_source (grl_registry_get_default (),
                                   grl_tracker_plugin,
-                                  GRL_SOURCE (source),
+                                  GRL_SOURCE (g_object_ref (source)),
                                   NULL);
   }
 }


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