OSDN Git Service

core: Fix crash when an invalid uuid is passed to Device1.DisconnectProfile
authorAlexandros Antonopoulos <alexandros.antonopoulos@oss.bmw-carit.de>
Mon, 21 Jan 2013 13:44:25 +0000 (14:44 +0100)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 21 Jan 2013 15:58:54 +0000 (17:58 +0200)
If the user calls Device1.DisconnectProfile with an invalid profile
uuid disconnect_profile still tries to parse the uuid resulting in
a SIGSEGV

src/device.c

index 3675616..bb79b38 100644 (file)
@@ -1269,6 +1269,8 @@ static DBusMessage *disconnect_profile(DBusConnection *conn, DBusMessage *msg,
                return btd_error_invalid_args(msg);
 
        uuid = bt_name2string(pattern);
+       if (uuid == NULL)
+               return btd_error_invalid_args(msg);
 
        p = find_connectable_profile(dev, uuid);
        g_free(uuid);