mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-01 09:08:06 +00:00
hfp_ag_demo, hfp_ag_client_test: avoid out-of-bounds stack read
This commit is contained in:
parent
f959ac69f5
commit
9b9bd84a4f
@ -443,10 +443,11 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * even
|
||||
|
||||
if (hci_event_packet_get_type(event) != HCI_EVENT_HFP_META) return;
|
||||
|
||||
if (event[3]
|
||||
&& hci_event_hfp_meta_get_subevent_code(event) != HFP_SUBEVENT_PLACE_CALL_WITH_NUMBER
|
||||
&& hci_event_hfp_meta_get_subevent_code(event) != HFP_SUBEVENT_ATTACH_NUMBER_TO_VOICE_TAG
|
||||
&& hci_event_hfp_meta_get_subevent_code(event) != HFP_SUBEVENT_TRANSMIT_DTMF_CODES){
|
||||
if ((event_size > 3)
|
||||
&& (event[3] != 0)
|
||||
&& (hci_event_hfp_meta_get_subevent_code(event) != HFP_SUBEVENT_PLACE_CALL_WITH_NUMBER)
|
||||
&& (hci_event_hfp_meta_get_subevent_code(event) != HFP_SUBEVENT_ATTACH_NUMBER_TO_VOICE_TAG)
|
||||
&& (hci_event_hfp_meta_get_subevent_code(event) != HFP_SUBEVENT_TRANSMIT_DTMF_CODES)){
|
||||
printf("ERROR, status: %u\n", event[3]);
|
||||
return;
|
||||
}
|
||||
|
@ -351,10 +351,11 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t * even
|
||||
|
||||
if (event[0] != HCI_EVENT_HFP_META) return;
|
||||
|
||||
if (event[3]
|
||||
&& event[2] != HFP_SUBEVENT_PLACE_CALL_WITH_NUMBER
|
||||
&& event[2] != HFP_SUBEVENT_ATTACH_NUMBER_TO_VOICE_TAG
|
||||
&& event[2] != HFP_SUBEVENT_TRANSMIT_DTMF_CODES){
|
||||
if ((event_size > 3)
|
||||
&& (event[3] != 0)
|
||||
&& (hci_event_hfp_meta_get_subevent_code(event) != HFP_SUBEVENT_PLACE_CALL_WITH_NUMBER)
|
||||
&& (hci_event_hfp_meta_get_subevent_code(event) != HFP_SUBEVENT_ATTACH_NUMBER_TO_VOICE_TAG)
|
||||
&& (hci_event_hfp_meta_get_subevent_code(event) != HFP_SUBEVENT_TRANSMIT_DTMF_CODES)){
|
||||
printf("ERROR, status: %u\n", event[3]);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user