Commit 05807641 authored by Joonghwan Lee's avatar Joonghwan Lee Committed by Randeep

Fix crash in ssl retransmission thread

It is possible to happen segmentation fault if retransmission thread
lock a mutex during CAdeinitSslAdapter function is called

Patch 1: Initial upload

Change-Id: I446aeb2cc9d6cd07d2683984ba2783ab72020c58
Signed-off-by: default avatarJoonghwan Lee <jh05.lee@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/16575Tested-by: default avatarjenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Randeep's avatarRandeep Singh <randeep.s@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17107
parent 886d3863
......@@ -1316,6 +1316,7 @@ static void StopRetransmit()
if (g_caSslContext)
{
unregisterTimer(g_caSslContext->timerId);
g_caSslContext->timerId= -1;
}
}
#endif
......@@ -1399,12 +1400,15 @@ static int StartRetransmit()
uint32_t listIndex = 0;
uint32_t listLength = 0;
SslEndPoint_t *tep = NULL;
oc_mutex_lock(g_sslContextMutex);
if (NULL == g_caSslContext)
{
OIC_LOG(ERROR, NET_SSL_TAG, "Context is NULL. Stop retransmission");
oc_mutex_unlock(g_sslContextMutex);
return -1;
}
oc_mutex_lock(g_sslContextMutex);
if (g_caSslContext->timerId != -1)
{
//clear previous timer
......
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