Try the Wireless Extension driver first for now
[connman] / gdbus / object.c
index 432a8a0..3186921 100644 (file)
@@ -2,7 +2,7 @@
  *
  *  D-Bus helper library
  *
- *  Copyright (C) 2004-2008  Marcel Holtmann <marcel@holtmann.org>
+ *  Copyright (C) 2004-2009  Marcel Holtmann <marcel@holtmann.org>
  *
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -224,6 +224,9 @@ static struct interface_data *find_interface(GSList *interfaces,
 {
        GSList *list;
 
+       if (!name)
+               return NULL;
+
        for (list = interfaces; list; list = list->next) {
                struct interface_data *iface = list->data;
                if (!strcmp(name, iface->name))
@@ -304,7 +307,11 @@ static void invalidate_parent_data(DBusConnection *conn, const char *child_path)
        if (!slash)
                goto done;
 
-       *slash = '\0';
+       if (slash == parent_path && parent_path[1] != '\0')
+               parent_path[1] = '\0';
+       else
+               *slash = '\0';
+
        if (!strlen(parent_path))
                goto done;
 
@@ -391,7 +398,6 @@ static gboolean check_signal(DBusConnection *conn, const char *path,
        }
 
        iface = find_interface(data->interfaces, interface);
-
        if (!iface) {
                error("dbus_connection_emit_signal: %s does not implement %s",
                                path, interface);
@@ -494,6 +500,9 @@ gboolean g_dbus_unregister_interface(DBusConnection *connection,
        struct generic_data *data = NULL;
        struct interface_data *iface;
 
+       if (!path)
+               return FALSE;
+
        if (dbus_connection_get_object_path_data(connection, path,
                                                (void *) &data) == FALSE)
                return FALSE;