(double free) crash occurred when discovering device
authoryoungman <yman.jung@samsung.com>
Fri, 12 Aug 2016 07:20:33 +0000 (16:20 +0900)
committerRandeep Singh <randeep.s@samsung.com>
Wed, 17 Aug 2016 05:46:38 +0000 (05:46 +0000)
Change-Id: I5ae6cbe8e62e5b0aeb0dd34a5d239cc7761b2ea9
Signed-off-by: youngman <yman.jung@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/10331
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Youngjae Shin <yj99.shin@samsung.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
resource/csdk/security/provisioning/include/pmutility.h
resource/csdk/security/provisioning/src/ocprovisioningmanager.c
resource/csdk/security/provisioning/src/pmutility.c

index c36b204..2a64248 100644 (file)
@@ -109,7 +109,7 @@ void PMPrintOCProvisionDev(const OCProvisionDev_t* pDev);
  * @return true when deletion is happened, false when no deletion is occured. In case either of
  * two arguments is null it will return false.
  */
-bool PMDeleteFromUUIDList(OCUuidList_t *pUuidList, OicUuid_t *targetId);
+bool PMDeleteFromUUIDList(OCUuidList_t **pUuidList, OicUuid_t *targetId);
 
 #ifdef __cplusplus
 }
index 85974cf..ae2f054 100644 (file)
@@ -891,7 +891,7 @@ OCStackResult OCGetDevInfoFromNetwork(unsigned short waittime,
     size_t deleteCnt = 0;
     while (pCurDev)
     {
-        if(true == PMDeleteFromUUIDList(uuidList, &pCurDev->doxm->deviceID))
+        if(true == PMDeleteFromUUIDList(&uuidList, &pCurDev->doxm->deviceID))
         {
             deleteCnt++;
         }
index b72c28c..7ce7bc8 100644 (file)
@@ -929,18 +929,18 @@ void PMPrintOCProvisionDev(const OCProvisionDev_t* pDev)
     }
 }
 
-bool PMDeleteFromUUIDList(OCUuidList_t *pUuidList, OicUuid_t *targetId)
+bool PMDeleteFromUUIDList(OCUuidList_t **pUuidList, OicUuid_t *targetId)
 {
-    if(pUuidList == NULL || targetId == NULL)
+    if(*pUuidList == NULL || targetId == NULL)
     {
         return false;
     }
     OCUuidList_t *tmp1 = NULL,*tmp2=NULL;
-    LL_FOREACH_SAFE(pUuidList, tmp1, tmp2)
+    LL_FOREACH_SAFE(*pUuidList, tmp1, tmp2)
     {
         if(0 == memcmp(tmp1->dev.id, targetId->id, sizeof(targetId->id)))
         {
-            LL_DELETE(pUuidList, tmp1);
+            LL_DELETE(*pUuidList, tmp1);
             OICFree(tmp1);
             return true;
         }