dbus: Make sure that subscription callbacks don't try to access removed objects.

This commit is contained in:
Tanu Kaskinen 2009-08-26 14:17:35 +03:00
parent 3e0e685a8c
commit edf80104e3
4 changed files with 143 additions and 72 deletions

View file

@ -274,6 +274,11 @@ static void subscription_cb(pa_core *core, pa_subscription_event_type_t t, uint3
pa_assert((t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_MODULE);
pa_assert(m);
/* We can't use idx != m->module->index, because the m->module pointer may
* be stale at this point. */
if (pa_idxset_get_by_index(core->modules, idx) != m->module)
return;
if ((t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) != PA_SUBSCRIPTION_EVENT_CHANGE)
return;