[Hotfix] Remove the segmentation fault while MOT.
authorChul Lee <chuls.lee@samsung.com>
Mon, 17 Oct 2016 12:09:46 +0000 (21:09 +0900)
committerRandeep Singh <randeep.s@samsung.com>
Mon, 17 Oct 2016 14:38:41 +0000 (14:38 +0000)
Segmentation fault was occured by https://gerrit.iotivity.org/gerrit/#/c/13299/

In this patch,
MOT device discovery will use the pCandidateList
to handle discovered device according to patch 13229.

Change-Id: I57d9a603602d49bb3f8e287ae1599f450a044731
Signed-off-by: Chul Lee <chuls.lee@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/13341
Reviewed-by: dongik Lee <dongik.lee@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
resource/csdk/security/provisioning/src/pmutility.c

index debfd30..e06e591 100644 (file)
@@ -1079,7 +1079,7 @@ static OCStackApplicationResult MOTDeviceDiscoveryHandler(void *ctx, OCDoHandle
 
                 //If this is owend device discovery we have to filter out the responses.
                 DiscoveryInfo* pDInfo = (DiscoveryInfo*)ctx;
-                OCProvisionDev_t **ppDevicesList = pDInfo->ppDevicesList;
+                OCProvisionDev_t **ppDevicesList = &pDInfo->pCandidateList;
 
                 // Get my device ID from doxm resource
                 OicUuid_t myId;
@@ -1219,6 +1219,7 @@ OCStackResult PMMultipleOwnerDeviceDiscovery(unsigned short waittime, bool isMul
     }
 
     pDInfo->ppDevicesList = ppDevicesList;
+    pDInfo->pCandidateList = NULL;
     pDInfo->isOwnedDiscovery = isMultipleOwned;
 
     OCCallbackData cbData;