Bluetooth: tester: Fix not checking btp2bt_uuid return value
btp2bt_uuid might return BTP_STATUS_FAILED. Procedure shall be aborted in this case. Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This commit is contained in:
parent
78aa543d6f
commit
c20af89020
1 changed files with 8 additions and 1 deletions
|
@ -1756,7 +1756,9 @@ static void get_attrs(u8_t *data, u16_t len)
|
|||
end_handle = sys_le16_to_cpu(cmd->end_handle);
|
||||
|
||||
if (cmd->type_length) {
|
||||
btp2bt_uuid(cmd->type, cmd->type_length, &uuid.uuid);
|
||||
if (btp2bt_uuid(cmd->type, cmd->type_length, &uuid.uuid)) {
|
||||
goto fail;
|
||||
}
|
||||
|
||||
SYS_LOG_DBG("start 0x%04x end 0x%04x, uuid %s", start_handle,
|
||||
end_handle, bt_uuid_str(&uuid.uuid));
|
||||
|
@ -1780,6 +1782,11 @@ static void get_attrs(u8_t *data, u16_t len)
|
|||
|
||||
tester_send(BTP_SERVICE_ID_GATT, GATT_GET_ATTRIBUTES, CONTROLLER_INDEX,
|
||||
buf->data, buf->len);
|
||||
|
||||
return;
|
||||
fail:
|
||||
tester_rsp(BTP_SERVICE_ID_GATT, GATT_GET_ATTRIBUTES, CONTROLLER_INDEX,
|
||||
BTP_STATUS_FAILED);
|
||||
}
|
||||
|
||||
static u8_t err_to_att(int err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue