summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2015-09-21 13:16:33 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2015-09-21 14:49:03 +0200
commit5221180a208c5e182c597e454b1d5285c933d45c (patch)
tree99b08182b4a5e438d37ab0607cdd34ad41f4b11c
parent73d2bd53c56e171d59370955c4790a8ce1e6797f (diff)
downloadNetworkManager-5221180a208c5e182c597e454b1d5285c933d45c.tar.gz
core: fix crash in NMManager message filter
g_dbus_message_get_interface() can return NULL in the message filter, for example when the client does: #!/usr/bin/env python import dbus bus = dbus.SystemBus() proxy = bus.get_object("org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager") proxy.foobar() Use g_strcmp0() to compare the interface and member names. Fixes: 34ba4e14b8674dc74327975159e101710ebd5403
-rw-r--r--src/nm-manager.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nm-manager.c b/src/nm-manager.c
index d19155e7c4..963ccd85ca 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -4572,8 +4572,8 @@ prop_filter (GDBusConnection *connection,
/* Only filter org.freedesktop.DBus.Properties.Set calls */
if ( !incoming
|| g_dbus_message_get_message_type (message) != G_DBUS_MESSAGE_TYPE_METHOD_CALL
- || strcmp (g_dbus_message_get_interface (message), DBUS_INTERFACE_PROPERTIES) != 0
- || strcmp (g_dbus_message_get_member (message), "Set") != 0)
+ || g_strcmp0 (g_dbus_message_get_interface (message), DBUS_INTERFACE_PROPERTIES) != 0
+ || g_strcmp0 (g_dbus_message_get_member (message), "Set") != 0)
return message;
/* Only filter calls with correct arguments (all filtered properties are boolean) */