addr_list = g_ptr_array_new();
if (addr_list == NULL) {
BT_ERR("OUT_OF_MEMORY(0x%08x)", BT_ERROR_OUT_OF_MEMORY);
+ g_free(uuid128);
return BT_ERROR_OUT_OF_MEMORY;
}
(bluetooth_gatt_server_write_requested_info_t *)(param->param_data);
char *val = g_malloc0(write_req->length);
+ if (val == NULL) {
+ BT_ERR("failed to allocate val");
+ return;
+ }
memcpy(val, write_req->data.data, write_req->length);
cb_wr = __bt_gatt_attribute_get_value_change_cb(write_req->attribute_handle,
TC_PRT("Local BT Interface : %s is Up", iface_name);
else
TC_PRT("Local BT Interface : %s is Down", iface_name);
- memcpy(ipsp_iface_name, iface_name, strlen(iface_name));
+ strncpy(ipsp_iface_name, iface_name, sizeof(ipsp_iface_name));
+ ipsp_iface_name[sizeof(ipsp_iface_name) - 1] = '\0';
}
void __bt_hf_sco_state_changed_cb(int result,
__bt_free_test_param(&g_test_param);
}
+ if (slot_id < 0 ||
+ slot_id >= (sizeof(advertiser_list) / sizeof(advertiser_list[0]))) {
+ TC_PRT("wrong slot_id: %d", slot_id);
+ break;
+ }
+
advertiser = advertiser_list[slot_id];
ret = bt_adapter_le_stop_advertising(advertiser);