(double free) crash occurred when discovering device 85/84385/1 accepted/tizen/common/20160818.144659 accepted/tizen/ivi/20160819.063442 accepted/tizen/mobile/20160819.063434 accepted/tizen/tv/20160819.063426 accepted/tizen/wearable/20160819.063415 submit/tizen/20160818.093637
authoryoungman <yman.jung@samsung.com>
Fri, 12 Aug 2016 07:20:33 +0000 (16:20 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Thu, 18 Aug 2016 08:50:06 +0000 (17:50 +0900)
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 c36b2041e4a6d767dae10fad424ccfb93505496d..2a642483167f5a89efe999da8d5f7f1eea10a441 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 1fb9388634cd07bfe2c3724670ab1eac15df702c..34d3a1ff45658985dde7d4411fb8adfc78e40125 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 56bf9b2402eed7831e7fd74ea33a939c275c10f5..47f1c3fa40d2df3a6e51f98e51de70912e4ff61f 100644 (file)
@@ -943,18 +943,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;
         }