Skip to content

Backport !3297 “gdbusinterfaceskeleton: Fix a use-after-free of a GDBusMethodInvocation” to glib-2-74

This GDBusMethodInvocation may be shared across threads, with no guarantee on the strong ref in one thread outlasting any refs in other threads — so it needs a ref in this helper struct.

This should fix a use-after-free where the GDBusMethodInvocation is freed from g_value_unset() after g_signal_emit() returns in dispatch_in_thread_func() in one thread; but then dereferenced again in g_source_destroy_internal() from another thread.

Signed-off-by: Philip Withnall pwithnall@endlessos.org

Fixes: #2924 (closed)

Closes #2924 (closed)


Trivial backport of !3297 (merged) to glib-2-74.

Merge request reports