diff options
| author | Arach MOHAMMED BRAHIM <arach.mohammed.brahim@st.com> | 2020-04-15 11:58:56 +0200 |
|---|---|---|
| committer | George Chang <georgekgchang@google.com> | 2020-04-21 10:03:43 +0000 |
| commit | 53fedaa8339733a2acc957e47f97a98f6ec1b202 (patch) | |
| tree | d3b44a0d46320be14eabff4f1de73018853a2249 | |
| parent | 34c23dd4bde8ca2aa94197eaf9d01f8dd785af7f (diff) | |
| download | platform_hardware_st_nfc-android11-dev.tar.gz platform_hardware_st_nfc-android11-dev.tar.bz2 platform_hardware_st_nfc-android11-dev.zip | |
Correct NCI command sizeandroid11-dev
In the case of FW log enable/disable, the command had a wrong size
Bug: 153988298
Test: check command length
Merged-In: Iba4569e0d4739ad725976da080f6ab3f8a3ad7f2
Change-Id: Iba4569e0d4739ad725976da080f6ab3f8a3ad7f2
| -rw-r--r-- | st21nfc/hal_wrapper.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/st21nfc/hal_wrapper.cc b/st21nfc/hal_wrapper.cc index ba0e6cc..e6b7cd1 100644 --- a/st21nfc/hal_wrapper.cc +++ b/st21nfc/hal_wrapper.cc @@ -199,6 +199,7 @@ void halWrapperDataCallback(uint16_t data_len, uint8_t* p_data) { uint8_t coreInitCmd[] = {0x20, 0x01, 0x02, 0x00, 0x00}; uint8_t coreResetCmd[] = {0x20, 0x00, 0x01, 0x01}; unsigned long num = 0; + int nciPropEnableFwDbgTraces_size = sizeof(nciPropEnableFwDbgTraces); switch (mHalWrapperState) { case HAL_WRAPPER_STATE_CLOSED: // 0 @@ -389,10 +390,14 @@ void halWrapperDataCallback(uint16_t data_len, uint8_t* p_data) { memcpy(nciPropEnableFwDbgTraces, nciHeaderPropSetConfig, 9); memcpy(&nciPropEnableFwDbgTraces[10], &p_data[8], p_data[6] - 1); + if ((9 + p_data[6]) < sizeof(nciPropEnableFwDbgTraces)) { + nciPropEnableFwDbgTraces_size = 9 + p_data[6]; + } + confNeeded = false; if (!HalSendDownstream(mHalHandle, nciPropEnableFwDbgTraces, - sizeof(nciPropEnableFwDbgTraces))) { + nciPropEnableFwDbgTraces_size)) { STLOG_HAL_E("%s - SendDownstream failed", __func__); } |
