Add param check code in PrepareMCertificateCallback.
authorChul Lee <chuls.lee@samsung.com>
Thu, 24 Nov 2016 07:37:35 +0000 (16:37 +0900)
committerRandeep Singh <randeep.s@samsung.com>
Thu, 24 Nov 2016 10:52:31 +0000 (10:52 +0000)
Change-Id: I1bd917024ab1ac20c000dccf9da5e31ba865a2a0
Signed-off-by: Chul Lee <chuls.lee@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/14737
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
resource/csdk/security/provisioning/src/oxmmanufacturercert.c

index f8b059229b3746fc422169ec42eea2a2c50357a2..7a24e998b31c78b0322ba928a5af5e7a3c1ffb2d 100644 (file)
@@ -78,6 +78,11 @@ OCStackResult PrepareMCertificateCallback(OTMContext_t *otmCtx)
 {
     OIC_LOG(INFO, TAG, "IN PrepareMCertificateCallback");
 
+    if (!otmCtx || !otmCtx->selectedDeviceInfo)
+    {
+        return OC_STACK_INVALID_PARAM;
+    }
+
     if (CA_STATUS_OK != CAregisterPkixInfoHandler(GetManufacturerPkixInfo))
     {
         OIC_LOG(ERROR, TAG, "Failed to register PkixInfohandler");