Skip to content

Backport "fdo notification backend: Crashes when dbus call fails" to glib-2-56

The way things were before: a FreedesktopNotification struct is allocated before the dbus call, and this same struct is possibly re-used for other dbus calls. If the server becomes unavailable, the callback will be invoked after the call times out, which leaves a long time where other dbus calls can happen, re-using the same FreedesktopNotification as user data. When the first call times out, the callback is invoked, and the user data is freed. Subsequent calls that used the same user data will time out later on, and try to free a pointer that was already freed, hence segfaults.

This bug can be reproduced in Cinnamon 3.6.7, as mentioned in: https://github.com/linuxmint/Cinnamon/issues/7491

This commit fixes that by always allocating a new FreedesktopNotification before invoking dbus_call(), ensuring that the callback always have a valid user data.

Signed-off-by: Arnaud Rebillout elboulangero@gmail.com

Helps #1280 (closed)

Merge request reports