--- /usr/src/dbus-0.50/glib/dbus-gproxy.c.orig 2005-09-29 15:53:43.000000000 +0100 +++ /usr/src/dbus-0.50/glib/dbus-gproxy.c 2005-09-29 18:26:30.000000000 +0100 @@ -176,6 +176,13 @@ /* Lock controlling get/set manager as data on each connection */ static GStaticMutex connection_g_proxy_lock = G_STATIC_MUTEX_INIT; +static int dbus_g_proxy_strcmp(const char *s1, const char *s2) +{ + if (!s1 || !s2) + return s1 == s2 ? 0 : (s1 ? 1 : -1); + return strcmp(s1, s2); +} + static DBusGProxyManager* dbus_g_proxy_manager_get (DBusConnection *connection) { @@ -364,7 +371,7 @@ ap += len + 1; bp += len + 1; - if (strcmp (ap, bp) != 0) + if (dbus_g_proxy_strcmp (ap, bp) != 0) return FALSE; return TRUE; @@ -494,7 +501,7 @@ const DBusGProxyNameOwnerInfo *info = a; const char *name = b; - return strcmp (info->name, name); + return dbus_g_proxy_strcmp (info->name, name); } typedef struct @@ -653,7 +660,7 @@ manager = proxy->manager; - if (!strcmp (proxy->name, name)) + if (!dbus_g_proxy_strcmp (proxy->name, name)) { if (!proxy->for_owner) { @@ -694,7 +701,7 @@ proxy = tmp->data; - if (!strcmp (proxy->name, name)) + if (!dbus_g_proxy_strcmp (proxy->name, name)) { removed = g_slist_prepend (removed, tmp); @@ -1307,7 +1314,7 @@ proxy = DBUS_G_PROXY (parent_class->constructor (type, n_construct_properties, construct_properties)); - proxy->for_owner = (proxy->name[0] == ':'); + proxy->for_owner = (proxy->name && proxy->name[0] == ':'); proxy->name_call = 0; proxy->associated = FALSE;