diff options
| author | Android Merger <noreply-android-build-merger@google.com> | 2019-08-13 21:36:01 +0000 |
|---|---|---|
| committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-08-13 21:36:01 +0000 |
| commit | fb2993d8b4be45ee482b3419a20b166f9305c221 (patch) | |
| tree | e9287fd4f94f38efc8b0b57daa6c2edbb1e11bc4 | |
| parent | bd9db4f5bf49dbbef010a043dbfc502d97da0d4f (diff) | |
| parent | 518cbc7a8c511d23508c8792b372f870759201bc (diff) | |
| download | platform_packages_apps_Nfc-pie-gsi.tar.gz platform_packages_apps_Nfc-pie-gsi.tar.bz2 platform_packages_apps_Nfc-pie-gsi.zip | |
Merge "Snap for 5674421 from 4c7873cc30820d666084bafcd90c903e589fd6bb to pi-platform-release am: 9547564713" into pie-gsipie-gsi
| -rw-r--r-- | nci/jni/extns/pn54x/src/mifare/phNxpExtns_MifareStd.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/nci/jni/extns/pn54x/src/mifare/phNxpExtns_MifareStd.cpp b/nci/jni/extns/pn54x/src/mifare/phNxpExtns_MifareStd.cpp index 1261c3fc..9f04c18b 100644 --- a/nci/jni/extns/pn54x/src/mifare/phNxpExtns_MifareStd.cpp +++ b/nci/jni/extns/pn54x/src/mifare/phNxpExtns_MifareStd.cpp @@ -16,6 +16,7 @@ #include <android-base/stringprintf.h> #include <base/logging.h> +#include <log/log.h> #include <nfc_api.h> #include <nfc_int.h> #include <phNfcCompId.h> @@ -993,12 +994,21 @@ NFCSTATUS Mfc_Transceive(uint8_t* p_data, uint32_t len) { NFCSTATUS status = NFCSTATUS_FAILED; uint8_t i = 0x00; + if (len == 0) { + android_errorWriteLog(0x534e4554, "132082342"); + return status; + } + gphNxpExtns_Context.RawWriteCallBack = false; gphNxpExtns_Context.CallBackMifare = NULL; gphNxpExtns_Context.CallBackCtxt = NdefMap; EXTNS_SetCallBackFlag(true); if (p_data[0] == 0x60 || p_data[0] == 0x61) { + if (len < 12) { + android_errorWriteLog(0x534e4554, "125900276"); + return status; + } NdefMap->Cmd.MfCmd = (phNfc_eMifareCmdList_t)p_data[0]; NdefMap->SendRecvBuf[i++] = p_data[1]; @@ -1857,6 +1867,11 @@ NFCSTATUS phFriNfc_ExtnsTransceive(phNfc_sTransceiveInfo_t* pTransceiveInfo, 0x00, 0x00, 0x00, 0x00, }; + if (SendLength == 0) { + android_errorWriteLog(0x534e4554, "132083376"); + return status; + } + buff = (uint8_t*)malloc((uint32_t)MAX_BUFF_SIZE); if (NULL == buff) { return status; |
