summaryrefslogtreecommitdiff
path: root/halimpl/mifare/NxpMfcReader.cc
diff options
context:
space:
mode:
Diffstat (limited to 'halimpl/mifare/NxpMfcReader.cc')
-rw-r--r--halimpl/mifare/NxpMfcReader.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/halimpl/mifare/NxpMfcReader.cc b/halimpl/mifare/NxpMfcReader.cc
index 315a803..17d9ed7 100644
--- a/halimpl/mifare/NxpMfcReader.cc
+++ b/halimpl/mifare/NxpMfcReader.cc
@@ -15,6 +15,7 @@
* limitations under the License.
*
******************************************************************************/
+#include <log/log.h>
#include "NxpMfcReader.h"
#include "phNxpNciHal.h"
#include <phNfcCompId.h>
@@ -43,6 +44,10 @@ int NxpMfcReader::Write(uint16_t mfcDataLen, const uint8_t *pMfcData) {
uint16_t mfcTagCmdBuffLen = 0;
uint8_t mfcTagCmdBuff[MAX_MFC_BUFF_SIZE] = {0};
+ if (mfcDataLen > MAX_MFC_BUFF_SIZE) {
+ android_errorWriteLog(0x534e4554, "169259605");
+ mfcDataLen = MAX_MFC_BUFF_SIZE;
+ }
memcpy(mfcTagCmdBuff, pMfcData, mfcDataLen);
if (mfcDataLen >= 3)
mfcTagCmdBuffLen = mfcDataLen - NCI_HEADER_SIZE;