diff options
author | Arnaud Ferir <arnaud.ferir@trusted-logic.com> | 2011-01-07 15:19:06 +0100 |
---|---|---|
committer | Nick Pelly <npelly@google.com> | 2011-01-18 15:29:13 -0800 |
commit | 44835562edd67f15196a47631a384afb1d8b8068 (patch) | |
tree | 6a5c85b382295a5dc2b7fe7290aa8597bbdcbaca /src/phFriNfc_LlcpTransport_Connection.c | |
parent | 99e7261d709ad32e0203dced9f4a386c5f719adf (diff) | |
download | external_libnfc-nxp-44835562edd67f15196a47631a384afb1d8b8068.zip external_libnfc-nxp-44835562edd67f15196a47631a384afb1d8b8068.tar.gz external_libnfc-nxp-44835562edd67f15196a47631a384afb1d8b8068.tar.bz2 |
Fixed NULL pointer error when trying to send LLCP REJECT frame.
The sequence value may not be provided in some situations, when
rejecting a connection oriented frame.
Change-Id: I116179191f9a23072442cf9da7a4c4207128bd32
Diffstat (limited to 'src/phFriNfc_LlcpTransport_Connection.c')
-rw-r--r-- | src/phFriNfc_LlcpTransport_Connection.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/phFriNfc_LlcpTransport_Connection.c b/src/phFriNfc_LlcpTransport_Connection.c index fbe2dec..18e2600 100644 --- a/src/phFriNfc_LlcpTransport_Connection.c +++ b/src/phFriNfc_LlcpTransport_Connection.c @@ -527,7 +527,7 @@ static NFCSTATUS phFriNfc_Llcp_Send_FrameReject_Frame(phFriNfc_LlcpTransport_t NFCSTATUS status = NFCSTATUS_SUCCESS; phNfc_sData_t sFrmrBuffer; uint8_t flagValue; - uint8_t sequence; + uint8_t sequence = 0; uint8_t index; uint8_t socketFound = FALSE; @@ -563,7 +563,10 @@ static NFCSTATUS phFriNfc_Llcp_Send_FrameReject_Frame(phFriNfc_LlcpTransport_t /* Set FRMR Information Field */ flagValue = (WFlag<<7) | (IFlag<<6) | (RFlag<<5) | (SFlag<<4) | rejectedPTYPE; - sequence = (uint8_t)((sLlcpSequence->ns<<4)|(sLlcpSequence->nr)); + if (sLlcpSequence != NULL) + { + sequence = (uint8_t)((sLlcpSequence->ns<<4)|(sLlcpSequence->nr)); + } psTransport->FrmrInfoBuffer[0] = flagValue; psTransport->FrmrInfoBuffer[1] = sequence; |