From 7fdc36d00ef56788fec4959783250d3fd0b12449 Mon Sep 17 00:00:00 2001 From: Christian Hammond Date: Wed, 27 Jul 2005 07:22:32 +0000 Subject: [PATCH] If the handle given in ActionInvoked is not found in the local table of handles, return from the ActionInvoked handler. Otherwise, every program using libnotify will crash when a notification is clicked. Oops! --- ChangeLog | 8 ++++++++ libnotify/notify.c | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 88dddf2..79dd675 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Wed Jul 27 00:18:16 PDT 2005 Christian Hammond + + * libnotify/notify.c: + - If the handle given in ActionInvoked is not found in the local + table of handles, return from the ActionInvoked handler. Otherwise, + every program using libnotify will crash when a notification is + clicked. Oops! + Sat Jul 16 02:53:06 PDT 2005 Christian Hammond * libnotify/notify.c: diff --git a/libnotify/notify.c b/libnotify/notify.c index 59bfef8..920af35 100644 --- a/libnotify/notify.c +++ b/libnotify/notify.c @@ -204,6 +204,9 @@ _filter_func(DBusConnection *dbus_conn, DBusMessage *message, void *user_data) handle = g_hash_table_lookup(_handles, &id); + if (handle == NULL) + goto exit; + if (handle->actions_table == NULL) { print_error("An action (%d) was invoked for a notification (%d) " @@ -230,6 +233,7 @@ _filter_func(DBusConnection *dbus_conn, DBusMessage *message, void *user_data) else return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; +exit: return DBUS_HANDLER_RESULT_HANDLED; }