OSDN Git Service

android: Fix sending remote device property if name is not present
authorSzymon Janc <szymon.janc@tieto.com>
Sat, 16 Nov 2013 14:09:44 +0000 (15:09 +0100)
committerJohan Hedberg <johan.hedberg@intel.com>
Sat, 16 Nov 2013 18:21:59 +0000 (20:21 +0200)
This fix missing bdaddr to string convertion if name was NULL. This
was resulting in using undefined dst value.

android/bluetooth.c

index 83f20e2..4439cc6 100644 (file)
@@ -589,8 +589,10 @@ static void send_remote_device_name_prop(const bdaddr_t *bdaddr)
 
        /* Use cached name or bdaddr string */
        name = get_device_name(bdaddr);
-       if (!name)
+       if (!name) {
+               ba2str(bdaddr, dst);
                name = dst;
+       }
 
        ev_len = BASELEN_REMOTE_DEV_PROP + strlen(name);
        ev = g_malloc0(ev_len);