Merge branch 'bugfix/ble_fix_exception_build_sr_msg_#12124' into 'master'

component/bt: fix the exception in attp_buil_sr_msg when handling gatt write bug. bug number #12124.

 fix the exception in attp_buil_sr_msg when handling gatt write bug. 

See merge request !743
pull/466/merge
Jiang Jiang Jian 2017-05-12 15:24:58 +08:00
commit 9a64744850
1 zmienionych plików z 20 dodań i 0 usunięć

Wyświetl plik

@ -375,6 +375,26 @@ BT_HDR *attp_build_sr_msg(tGATT_TCB *p_tcb, UINT8 op_code, tGATT_SR_MSG *p_msg)
BT_HDR *p_cmd = NULL;
UINT16 offset = 0;
switch (op_code) {
case GATT_RSP_READ_BLOB:
case GATT_RSP_PREPARE_WRITE:
case GATT_RSP_READ_BY_TYPE:
case GATT_RSP_READ:
case GATT_HANDLE_VALUE_NOTIF:
case GATT_HANDLE_VALUE_IND:
case GATT_RSP_ERROR:
case GATT_RSP_MTU:
/* Need to check the validation of parameter p_msg*/
if (p_msg == NULL) {
GATT_TRACE_ERROR("Invalid parameters in %s, op_code=0x%x, the p_msg should not be NULL.", __func__, op_code);
return NULL;
}
break;
default:
break;
}
switch (op_code) {
case GATT_RSP_READ_BLOB:
case GATT_RSP_PREPARE_WRITE: