• 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

Revisionc5e276fdf72b104e58ddf80cfa9424012422b95e (tree)
Time2019-01-18 19:52:46
AuthorMyles Watson <mylesgw@goog...>
CommiterVasyl Gello

Log Message

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 b8fbe73f0d32686e8393bfe07a84b6f0e8829caf)

Change Summary

Incremental Difference

--- a/bta/hh/bta_hh_act.c
+++ b/bta/hh/bta_hh_act.c
@@ -26,6 +26,7 @@
2626
2727 #if defined(BTA_HH_INCLUDED) && (BTA_HH_INCLUDED == TRUE)
2828
29+#include <log/log.h>
2930 #include <string.h>
3031
3132 #include "bta_sys.h"
@@ -777,6 +778,13 @@ void bta_hh_ctrl_dat_act(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA * p_data)
777778 APPL_TRACE_DEBUG("Ctrl DATA received w4: event[%s]",
778779 bta_hh_get_w4_event(p_cb->w4_evt));
779780 #endif
781+ if (pdata->len == 0)
782+ {
783+ android_errorWriteLog(0x534e4554, "116108738");
784+ p_cb->w4_evt = 0;
785+ osi_free_and_reset((void**)&pdata);
786+ return;
787+ }
780788 hs_data.status = BTA_HH_OK;
781789 hs_data.handle = p_cb->hid_handle;
782790