aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-04-22 01:09:41 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-04-22 01:09:41 +0000
commit21b268f6c90516d9066f078aa232af1315cd74af (patch)
treed3b44a0d46320be14eabff4f1de73018853a2249
parent447e2c6e8f2d746859fcd22452f720b86c77d770 (diff)
parent53fedaa8339733a2acc957e47f97a98f6ec1b202 (diff)
downloadplatform_hardware_st_nfc-android11-tests-release.tar.gz
platform_hardware_st_nfc-android11-tests-release.tar.bz2
platform_hardware_st_nfc-android11-tests-release.zip
Change-Id: I97c0a8bde05b5f4281e1d9cff0c335bf7d6c845b
-rw-r--r--st21nfc/hal_wrapper.cc7
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__);
}