summaryrefslogtreecommitdiff
path: root/src/phFriNfc_LlcpTransport_Connection.c
diff options
context:
space:
mode:
authorSylvain Fonteneau <sylvain.fonteneau@trusted-logic.com>2011-04-04 16:45:28 +0200
committerJeff Hamilton <jham@android.com>2011-04-08 10:39:54 -0500
commit46dbed4e11700226e9b43ca17e5ad6f3d192bf63 (patch)
tree68c6a2a7db7f4754add47aff93ba2501e102ed68 /src/phFriNfc_LlcpTransport_Connection.c
parentb7e67c8dbd4aa5892815bfed4e7ff934cf49b904 (diff)
downloadlibnfc-nxp-46dbed4e11700226e9b43ca17e5ad6f3d192bf63.tar.gz
Ignore unreadable TLVs during LLCP activation and CONNECT/CC.
The LLCP specification defines that if a TLV cannot be interpreted, it shall be ignored rather than generating an error. This patch removed all error reporting on TLV interpretation. The only error that can still happen is length inconsistency in the whole TLV array buffer. Change-Id: Ibf289fceb2283bfddcdc0ddee9e687ece3e90887
Diffstat (limited to 'src/phFriNfc_LlcpTransport_Connection.c')
-rw-r--r--src/phFriNfc_LlcpTransport_Connection.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/phFriNfc_LlcpTransport_Connection.c b/src/phFriNfc_LlcpTransport_Connection.c
index fff63b4..fcdb246 100644
--- a/src/phFriNfc_LlcpTransport_Connection.c
+++ b/src/phFriNfc_LlcpTransport_Connection.c
@@ -627,7 +627,7 @@ static NFCSTATUS phFriNfc_Llcp_GetSocket_Params(phNfc_sData_t
if(sValueBuffer.length == 0)
{
/* Error : Ill-formed SN parameter TLV */
- return PHNFCSTVAL(CID_FRI_NFC_LLCP,NFCSTATUS_INVALID_PARAMETER);
+ break;
}
/* Get the Service Name */
*psServiceName = sValueBuffer;
@@ -639,7 +639,7 @@ static NFCSTATUS phFriNfc_Llcp_GetSocket_Params(phNfc_sData_t
if (sValueBuffer.length != PHFRINFC_LLCP_TLV_LENGTH_RW)
{
/* Error : Ill-formed MIUX parameter TLV */
- return PHNFCSTVAL(CID_FRI_NFC_LLCP,NFCSTATUS_INVALID_PARAMETER);
+ break;
}
*pRemoteRW_Size = sValueBuffer.buffer[0];
}break;
@@ -650,10 +650,16 @@ static NFCSTATUS phFriNfc_Llcp_GetSocket_Params(phNfc_sData_t
if (sValueBuffer.length != PHFRINFC_LLCP_TLV_LENGTH_MIUX)
{
/* Error : Ill-formed MIUX parameter TLV */
- return PHNFCSTVAL(CID_FRI_NFC_LLCP,NFCSTATUS_INVALID_PARAMETER);
+ break;
}
*pRemoteMIU = PHFRINFC_LLCP_MIU_DEFAULT + (((sValueBuffer.buffer[0] << 8) | sValueBuffer.buffer[1]) & PHFRINFC_LLCP_TLV_MIUX_MASK);
}break;
+
+ default:
+ {
+ /* Error : Unknown type */
+ break;
+ }
}
}
}