summaryrefslogtreecommitdiff
path: root/android/hal-health.c
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@tieto.com>2014-06-16 15:27:35 +0200
committerSzymon Janc <szymon.janc@tieto.com>2014-06-16 16:03:55 +0200
commit843c90dfc5e2b25da998069a7683e74292d205c2 (patch)
treebc93ed511d9760172e8bad6d03858f00f9dcc0f2 /android/hal-health.c
parenta36ee4a4eecb4fc5f3667ce1c3304092f414909b (diff)
downloadbluez-843c90dfc5e2b25da998069a7683e74292d205c2.tar.gz
android/hal-health: Fix not setting offsets for empty strings
In register_app command all strings except app name are optional. Those are passed over IPC concatenated and offsets are used to determine string presence and length.
Diffstat (limited to 'android/hal-health.c')
-rw-r--r--android/hal-health.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/android/hal-health.c b/android/hal-health.c
index 012b6b72d..ab0665804 100644
--- a/android/hal-health.c
+++ b/android/hal-health.c
@@ -93,23 +93,23 @@ static bt_status_t register_application(bthl_reg_param_t *reg, int *app_id)
memcpy(cmd->data, reg->application_name, len);
off += len;
+ cmd->provider_name_off = off;
if (reg->provider_name) {
len = strlen(reg->provider_name) + 1;
- cmd->provider_name_off = off;
memcpy(cmd->data + off, reg->provider_name, len);
off += len;
}
+ cmd->service_name_off = off;
if (reg->srv_name) {
len = strlen(reg->srv_name) + 1;
- cmd->service_name_off = off;
memcpy(cmd->data + off, reg->srv_name, len);
off += len;
}
+ cmd->service_descr_off = off;
if (reg->srv_desp) {
len = strlen(reg->srv_desp) + 1;
- cmd->service_descr_off = off;
memcpy(cmd->data + off, reg->srv_desp, len);
off += len;
}