summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/phFriNfc_OvrHal.c5
-rw-r--r--src/phHal4Nfc_ADD.c13
2 files changed, 12 insertions, 6 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/phHal4Nfc_ADD.c b/src/phHal4Nfc_ADD.c
index 0a3303c..727b7c4 100644
--- a/src/phHal4Nfc_ADD.c
+++ b/src/phHal4Nfc_ADD.c
@@ -671,11 +671,14 @@ 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)
- );
+ 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;
}