[CONPRO-1564] Doxm deadlock 87/225287/2
authorOleksii Beketov <ol.beketov@samsung.com>
Thu, 13 Feb 2020 11:53:23 +0000 (13:53 +0200)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Wed, 19 Feb 2020 00:14:40 +0000 (09:14 +0900)
Deadlock in case of not supported oxm method fixed

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/665
(cherry-picked from 2ce7a0c66285f62eeac4db9260cea0f077adf2ad)

Change-Id: I280d323cd27eccfe233e0ea91efc2a4cb393591e
Signed-off-by: Oleksii Beketov <ol.beketov@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
resource/csdk/security/src/doxmresource.c

index 98c8405..91f104d 100644 (file)
@@ -1449,6 +1449,10 @@ static OCEntityHandlerResult HandleDoxmPostRequest(OCEntityHandlerRequest * ehRe
                 if (false == ValidateOxmsel(gDoxm->oxm, gDoxm->oxmLen, &newDoxm->oxmSel))
                 {
                     OIC_LOG(ERROR, TAG, "Not acceptable request because oxmsel does not support on Server");
+                    if (NULL != g_mutexDoxm)
+                    {
+                        oc_mutex_unlock(g_mutexDoxm);
+                    }
                     ehRet = OC_EH_NOT_ACCEPTABLE;
                     goto exit;
                 }
@@ -1546,6 +1550,10 @@ static OCEntityHandlerResult HandleDoxmPostRequest(OCEntityHandlerRequest * ehRe
                 if (false == ValidateOxmsel(gDoxm->oxm, gDoxm->oxmLen, &newDoxm->oxmSel))
                 {
                     OIC_LOG(ERROR, TAG, "Not acceptable request because oxmsel does not support on Server");
+                    if (NULL != g_mutexDoxm)
+                    {
+                        oc_mutex_unlock(g_mutexDoxm);
+                    }
                     ehRet = OC_EH_NOT_ACCEPTABLE;
                     goto exit;
                 }