summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGanesh Ganapathi Batta <ganeshg@broadcom.com>2012-08-02 17:38:48 -0700
committerMatthew Xie <mattx@google.com>2012-08-09 23:00:26 -0700
commit3d50b084b10de8feca0d9edb51fa69591de37a17 (patch)
tree9637e211364d0fe09f2183ab05d4f08eb5afc7ac
parentb7049f8573901ca12738fc47508a31ccb1de1c1c (diff)
downloadexternal_bluetooth_bluedroid-3d50b084b10de8feca0d9edb51fa69591de37a17.zip
external_bluetooth_bluedroid-3d50b084b10de8feca0d9edb51fa69591de37a17.tar.gz
external_bluetooth_bluedroid-3d50b084b10de8feca0d9edb51fa69591de37a17.tar.bz2
Fix issue with passing wrong str len to java layer
Send only length of string to Java instead of length +1 from btif for local Bluetooth name, Remote name and Friendly name for paired devices. Change-Id: I4e822db62eb2affaadad283c6ceb2a368e3b107c
-rwxr-xr-x[-rw-r--r--]btif/src/btif_dm.c4
-rwxr-xr-x[-rw-r--r--]btif/src/btif_storage.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/btif/src/btif_dm.c b/btif/src/btif_dm.c
index 4b43b6a..32cb0d1 100644..100755
--- a/btif/src/btif_dm.c
+++ b/btif/src/btif_dm.c
@@ -308,7 +308,7 @@ static void btif_update_remote_properties(BD_ADDR bd_addr, BD_NAME bd_name,
if (strlen((const char *) bd_name))
{
BTIF_STORAGE_FILL_PROPERTY(&properties[num_properties],
- BT_PROPERTY_BDNAME, strlen((char *)bd_name)+1, bd_name);
+ BT_PROPERTY_BDNAME, strlen((char *)bd_name), bd_name);
status = btif_storage_set_remote_device_property(&bdaddr, &properties[num_properties]);
ASSERTC(status == BT_STATUS_SUCCESS, "failed to save remote device name", status);
num_properties++;
@@ -1638,7 +1638,7 @@ bt_status_t btif_dm_get_adapter_property(bt_property_t *prop)
{
bt_bdname_t *bd_name = (bt_bdname_t*)prop->val;
strcpy((char *)bd_name->name, (char *)BTM_DEF_LOCAL_NAME);
- prop->len = strlen((char *)bd_name->name)+1;
+ prop->len = strlen((char *)bd_name->name);
}
break;
diff --git a/btif/src/btif_storage.c b/btif/src/btif_storage.c
index bc7b771..4d80914 100644..100755
--- a/btif/src/btif_storage.c
+++ b/btif/src/btif_storage.c
@@ -353,7 +353,7 @@ static bt_status_t btif_in_str_to_property(char *value, bt_property_t *property)
*((char*)property->val) = 0;
if (value)
{
- property->len = strlen(value)+1;
+ property->len = strlen(value);
strcpy((char*)property->val, value);
}
} break;