mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 11:26:16 +01:00
gdbusdaemon: Fix error handling for filtering outgoing messages
If the filter function for an outgoing message fails to copy the GDBusMessage, that failure was previously ignored, and GDBusMessage methods could be called on a NULL instance. Avoid that. Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
parent
2dac148299
commit
96aa2e34b3
@ -1493,16 +1493,21 @@ filter_function (GDBusConnection *connection,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (g_dbus_message_get_sender (message) == NULL ||
|
||||||
|
g_dbus_message_get_destination (message) == NULL)
|
||||||
|
{
|
||||||
|
message = copy_if_locked (message);
|
||||||
|
if (message == NULL)
|
||||||
|
{
|
||||||
|
g_warning ("Failed to copy outgoing message");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (g_dbus_message_get_sender (message) == NULL)
|
if (g_dbus_message_get_sender (message) == NULL)
|
||||||
{
|
g_dbus_message_set_sender (message, DBUS_SERVICE_NAME);
|
||||||
message = copy_if_locked (message);
|
|
||||||
g_dbus_message_set_sender (message, DBUS_SERVICE_NAME);
|
|
||||||
}
|
|
||||||
if (g_dbus_message_get_destination (message) == NULL)
|
if (g_dbus_message_get_destination (message) == NULL)
|
||||||
{
|
g_dbus_message_set_destination (message, client->id);
|
||||||
message = copy_if_locked (message);
|
|
||||||
g_dbus_message_set_destination (message, client->id);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return message;
|
return message;
|
||||||
|
Loading…
Reference in New Issue
Block a user