• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/bt


Commit MetaInfo

Revision8aba91ab967ed6cd1edba9062e723b57738e9303 (tree)
Time2019-12-21 03:35:38
AuthorMike Logan <mikelogan@goog...>
CommiterAndroid (Google) Code Review

Log Message

Merge "HCI: Check length of connection complete event" into qt-qpr1-dev

Change Summary

Incremental Difference

--- a/stack/btu/btu_hcif.cc
+++ b/stack/btu/btu_hcif.cc
@@ -69,7 +69,7 @@ static void btu_hcif_inquiry_rssi_result_evt(uint8_t* p, uint8_t hci_evt_len);
6969 static void btu_hcif_extended_inquiry_result_evt(uint8_t* p,
7070 uint8_t hci_evt_len);
7171
72-static void btu_hcif_connection_comp_evt(uint8_t* p);
72+static void btu_hcif_connection_comp_evt(uint8_t* p, uint8_t evt_len);
7373 static void btu_hcif_connection_request_evt(uint8_t* p);
7474 static void btu_hcif_disconnection_comp_evt(uint8_t* p);
7575 static void btu_hcif_authentication_comp_evt(uint8_t* p);
@@ -273,7 +273,7 @@ void btu_hcif_process_event(UNUSED_ATTR uint8_t controller_id, BT_HDR* p_msg) {
273273 btu_hcif_extended_inquiry_result_evt(p, hci_evt_len);
274274 break;
275275 case HCI_CONNECTION_COMP_EVT:
276- btu_hcif_connection_comp_evt(p);
276+ btu_hcif_connection_comp_evt(p, hci_evt_len);
277277 break;
278278 case HCI_CONNECTION_REQUEST_EVT:
279279 btu_hcif_connection_request_evt(p);
@@ -992,7 +992,7 @@ static void btu_hcif_extended_inquiry_result_evt(uint8_t* p,
992992 * Returns void
993993 *
994994 ******************************************************************************/
995-static void btu_hcif_connection_comp_evt(uint8_t* p) {
995+static void btu_hcif_connection_comp_evt(uint8_t* p, uint8_t evt_len) {
996996 uint8_t status;
997997 uint16_t handle;
998998 RawAddress bda;
@@ -1000,6 +1000,12 @@ static void btu_hcif_connection_comp_evt(uint8_t* p) {
10001000 uint8_t enc_mode;
10011001 tBTM_ESCO_DATA esco_data;
10021002
1003+ if (evt_len < 11) {
1004+ android_errorWriteLog(0x534e4554, "141619686");
1005+ HCI_TRACE_WARNING("%s: malformed event of size %hhd", __func__, evt_len);
1006+ return;
1007+ }
1008+
10031009 STREAM_TO_UINT8(status, p);
10041010 STREAM_TO_UINT16(handle, p);
10051011 STREAM_TO_BDADDR(bda, p);