Commit 1a32ec0a authored by Senthil Kumar G S's avatar Senthil Kumar G S Committed by Ashok Babu Channa

[IOT-2339] Add NULL check before variable access.

Added null check for 'sendData->remoteEndpoint' before the members
of remoteEndpoint gets accessed.

Change-Id: Ic4fc56087bcf9f72233f823ab5aaf0c39ec34afa
Signed-off-by: default avatarSenthil Kumar G S <senthil.gs@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/22271Tested-by: default avatarjenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: default avatarHarish Marappa <h.marappa@samsung.com>
Reviewed-by: default avatarAshok Babu Channa <ashok.channa@samsung.com>
parent 578ba076
......@@ -944,7 +944,7 @@ CAResult_t CASetNextBlockOption1(coap_pdu_t *pdu, const CAEndpoint_t *endpoint,
(CAToken_t)pdu->transport_hdr->udp.token,
(uint8_t)pdu->transport_hdr->udp.token_length,
endpoint->addr, endpoint->port);
if ((NULL == blockDataID) || (blockDataID->idLength < 1) ||
if ((NULL == blockDataID) || (blockDataID->idLength < 1) ||
(blockDataID->idLength > UINT8_MAX))
{
OIC_LOG(ERROR, TAG, "blockId is incorrect");
......@@ -2501,7 +2501,7 @@ CAResult_t CACheckBlockDataValidation(const CAData_t *sendData, CABlockData_t **
VERIFY_NON_NULL(sendData, TAG, "sendData");
VERIFY_NON_NULL(blockData, TAG, "blockData");
if (sendData->responseInfo)
if (sendData->responseInfo && sendData->remoteEndpoint)
{
CABlockDataID_t* blockDataID = CACreateBlockDatablockId(
(CAToken_t)sendData->responseInfo->info.token,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment