diff options
author | Sunil Jogi <sunil.jogi@nxp.com> | 2012-09-24 14:47:18 -0700 |
---|---|---|
committer | Martijn Coenen <maco@google.com> | 2012-11-27 17:35:13 -0800 |
commit | 35f614f9db6e01ed6d07eda5fba5d647839d50a3 (patch) | |
tree | 7d7ce37d028aabaf4187a71b04c12e1ee029b489 | |
parent | 68c93f6f41998fbff40a3396a633faee4d595695 (diff) | |
download | external_libnfc-nxp-35f614f9db6e01ed6d07eda5fba5d647839d50a3.zip external_libnfc-nxp-35f614f9db6e01ed6d07eda5fba5d647839d50a3.tar.gz external_libnfc-nxp-35f614f9db6e01ed6d07eda5fba5d647839d50a3.tar.bz2 |
NDEF Type 3 tag reading with padding bytes
NDEF Type 3 tag reading was not ignoring the padding bytes, which
leads to failure of parsing the NDEF data. This patch fix that problem.
Bug: 7600630
Change-Id: I45cf1841bdc343503a8a12d622ac8470c3e64ce4
-rw-r--r-- | src/phFriNfc_FelicaMap.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/phFriNfc_FelicaMap.c b/src/phFriNfc_FelicaMap.c index 8a810f9..39b98d9 100644 --- a/src/phFriNfc_FelicaMap.c +++ b/src/phFriNfc_FelicaMap.c @@ -631,6 +631,7 @@ static NFCSTATUS phFriNfc_Felica_HChkApduBuff_Size( phFriNfc_NdefMap_t *NdefMap) NFCSTATUS status = NFCSTATUS_PENDING; uint8_t ResetFlag = FALSE; uint32_t Nbc = 0; + uint32_t DataLen = 0; Nbc = phFriNfc_Felica_HGetMaximumBlksToRead(NdefMap,PH_NFCFRI_NDEFMAP_FELI_NBC); @@ -733,7 +734,18 @@ static NFCSTATUS phFriNfc_Felica_HChkApduBuff_Size( phFriNfc_NdefMap_t *NdefMap) } if ( ResetFlag == TRUE) { - *NdefMap->NumOfBytesRead = NdefMap->ApduBuffIndex; + PH_NFCFRI_NDEFMAP_FELI_CAL_LEN_BYTES(NdefMap->FelicaAttrInfo.LenBytes[0], + NdefMap->FelicaAttrInfo.LenBytes[1], + NdefMap->FelicaAttrInfo.LenBytes[2], + DataLen); + if (NdefMap->ApduBuffIndex > DataLen) + { + *NdefMap->NumOfBytesRead = DataLen; + } + else + { + *NdefMap->NumOfBytesRead = NdefMap->ApduBuffIndex; + } /*Reset the index, internal buffer counters back to zero*/ NdefMap->ApduBuffIndex = 0; NdefMap->Felica.Rd_NoBytesToCopy=0; |