system/bt
Revision | 8ec7232610d39d589e0d21e7c6aa76e4d128b9c3 (tree) |
---|---|
Time | 2018-11-06 06:52:57 |
Author | Myles Watson <mylesgw@goog...> |
Commiter | Rohit Yengisetty |
DO NOT MERGE: HH: Check parameter length in bta_hh_ctrl_dat_act
Bug: 116108738
Test: send a malformed GET_IDLE command with no parameters
Change-Id: Ic57e748a06ea6d4fc16868310d3423ee71a7ac8c
(cherry picked from commit a4a11e198164027f86e74e10aa68b9327df5b589)
@@ -26,6 +26,7 @@ | ||
26 | 26 | |
27 | 27 | #if defined(BTA_HH_INCLUDED) && (BTA_HH_INCLUDED == TRUE) |
28 | 28 | |
29 | +#include <log/log.h> | |
29 | 30 | #include <string.h> |
30 | 31 | |
31 | 32 | #include "bta_sys.h" |
@@ -764,6 +765,12 @@ void bta_hh_ctrl_dat_act(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA * p_data) | ||
764 | 765 | APPL_TRACE_DEBUG("Ctrl DATA received w4: event[%s]", |
765 | 766 | bta_hh_get_w4_event(p_cb->w4_evt)); |
766 | 767 | #endif |
768 | + if (pdata->len == 0) { | |
769 | + android_errorWriteLog(0x534e4554, "116108738"); | |
770 | + p_cb->w4_evt = 0; | |
771 | + osi_free_and_reset((void**)&pdata); | |
772 | + return; | |
773 | + } | |
767 | 774 | hs_data.status = BTA_HH_OK; |
768 | 775 | hs_data.handle = p_cb->hid_handle; |
769 | 776 |