Crash at CADestroyDataSet() 32/215632/1
authorsourav bhuwalka <s.bhuwalka@samsung.com>
Thu, 26 Sep 2019 18:10:08 +0000 (23:40 +0530)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 14 Oct 2019 00:57:59 +0000 (09:57 +0900)
Setting info->token to NULL after free to avoid double free

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/582
(cherry-picked from 3fb0338b52b04ee58f12bb46f27ef20cf12c2d47)

Change-Id: If6268f9ebb9965b84809c54d38b3b3826cf51830
Signed-off-by: sourav bhuwalka <s.bhuwalka@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
resource/csdk/connectivity/src/camessagehandler.c

index c4b25dd..c91f820 100644 (file)
@@ -861,6 +861,7 @@ static CAResult_t CAReceivedPacketCallback(const CASecureEndpoint_t *sep,
                     {
                         OIC_LOG(ERROR, TAG, "fail to get Token from retransmission list");
                         OICFree(info->token);
+                        info->token = NULL;
                         info->tokenLength = 0;
                     }
                 }