summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/phFriNfc_OvrHal.c5
-rw-r--r--src/phFriNfc_TopazDynamicMap.c5
-rwxr-xr-xsrc/phHal4Nfc_ADD.c15
-rwxr-xr-xsrc/phHciNfc_AdminMgmt.c1
4 files changed, 18 insertions, 8 deletions
diff --git a/src/phFriNfc_OvrHal.c b/src/phFriNfc_OvrHal.c
index 539210e..9efff94 100644
--- a/src/phFriNfc_OvrHal.c
+++ b/src/phFriNfc_OvrHal.c
@@ -323,7 +323,10 @@ static void phFriNfc_OvrHal_CB_Transceive(void *context,
if(NULL != pRecvdata && OvrHal->TranceiveInfo.sRecvData.buffer != NULL && pRecvdata->buffer != NULL)
{
/* Work-around for the NFCIP Tranceive API */
- memcpy(OvrHal->TranceiveInfo.sRecvData.buffer, pRecvdata->buffer, pRecvdata->length);
+ if (OvrHal->TranceiveInfo.sRecvData.buffer != pRecvdata->buffer)
+ {
+ memcpy(OvrHal->TranceiveInfo.sRecvData.buffer, pRecvdata->buffer, pRecvdata->length);
+ }
if (OvrHal->pndef_recv_length != NULL)
{
*OvrHal->pndef_recv_length = (uint16_t) pRecvdata->length;
diff --git a/src/phFriNfc_TopazDynamicMap.c b/src/phFriNfc_TopazDynamicMap.c
index 2aa29ea..e9d1529 100644
--- a/src/phFriNfc_TopazDynamicMap.c
+++ b/src/phFriNfc_TopazDynamicMap.c
@@ -199,6 +199,9 @@ so there are 4 segements in the card */
((((block_no) + 1) == TOPAZ_STATIC_LOCK_FIRST_BLOCK_NO) ? \
(((block_no) + 1) + TOPAZ_STATIC_LOCK_BLOCK_AREAS) : \
((block_no) + 1))
+/* Check topaz spec version number */
+#define TOPAZ_COMPARE_VERSION(device_ver, tag_ver) \
+ ((device_ver & 0xF0) >= (tag_ver & 0xF0))
#ifdef FRINFC_READONLY_NDEF
@@ -2368,7 +2371,7 @@ phFriNfc_Tpz_H_CheckCCBytesForWrite (
{
check_index = (uint8_t)(check_index + 1);
- if ((check_cc_rw[0] != ps_tpz_info->CCByteBuf[1]) ||
+ if ((!TOPAZ_COMPARE_VERSION(check_cc_rw[0], ps_tpz_info->CCByteBuf[1])) ||
(check_cc_rw[1] != ps_tpz_info->CCByteBuf[2]) ||
(check_cc_rw[2] != ps_tpz_info->CCByteBuf[3]))
{
diff --git a/src/phHal4Nfc_ADD.c b/src/phHal4Nfc_ADD.c
index 54dd1c1..9461e43 100755
--- a/src/phHal4Nfc_ADD.c
+++ b/src/phHal4Nfc_ADD.c
@@ -671,12 +671,15 @@ void phHal4Nfc_TargetDiscoveryComplete(
if(phHal_eNfcIP1_Target ==
Hal4Ctxt->rem_dev_list[Count-1]->RemDevType)
{
- (void)memcpy(
- (void *)Hal4Ctxt->rem_dev_list[0],
- (void *)Hal4Ctxt->rem_dev_list[Count-1],
- sizeof(phHal_sRemoteDevInformation_t)
- );
- NfcIpDeviceCount = 1;
+ if (Count != 1)
+ {
+ (void)memcpy(
+ (void *)Hal4Ctxt->rem_dev_list[0],
+ (void *)Hal4Ctxt->rem_dev_list[Count-1],
+ sizeof(phHal_sRemoteDevInformation_t)
+ );
+ }
+ NfcIpDeviceCount = 1;
break;
}
}
diff --git a/src/phHciNfc_AdminMgmt.c b/src/phHciNfc_AdminMgmt.c
index ba8a023..312aa66 100755
--- a/src/phHciNfc_AdminMgmt.c
+++ b/src/phHciNfc_AdminMgmt.c
@@ -1006,6 +1006,7 @@ static
pipe_id = hcp_message->payload[RESPONSE_PIPEID_OFFSET];
p_pipe_info = (phHciNfc_Pipe_Info_t *)
phOsalNfc_GetMemory(sizeof(phHciNfc_Pipe_Info_t));
+ memset(p_pipe_info, 0, sizeof(phHciNfc_Pipe_Info_t));
if(NULL != p_pipe_info)
{
/* The Source Host is the UICC Host */