Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gfdonotificationbackend: Fix possible invalid pointer in dbus callback
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: <linuxmint/cinnamon#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>
- Loading branch information
1 parent
4a27a88
commit d26b66e
Showing
1 changed file
with
34 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters