Check that device name is valid before using it
authorMarcel Holtmann <marcel@holtmann.org>
Tue, 30 Dec 2008 20:27:22 +0000 (21:27 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 30 Dec 2008 20:27:22 +0000 (21:27 +0100)
plugins/bluetooth.c

index 1799f77..13f7d92 100644 (file)
@@ -412,7 +412,7 @@ static void adapter_properties(DBusConnection *connection, const char *path,
 
        connman_device_set_path(adapter, path);
 
-       if (g_str_has_prefix(node, "hci") == TRUE) {
+       if (node != NULL && g_str_has_prefix(node, "hci") == TRUE) {
                int index;
                errno = 0;
                index = atoi(node + 3);