resolved svace issues
authorRandeep Singh <randeep.s@samsung.com>
Tue, 29 Nov 2016 11:14:30 +0000 (16:44 +0530)
committerRandeep Singh <randeep.s@samsung.com>
Wed, 30 Nov 2016 09:16:32 +0000 (09:16 +0000)
Change-Id: If2b022d06a46c46cba1b3535c49ddcdbc794bf3c
Signed-off-by: Randeep Singh <randeep.s@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/14907
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Reviewed-by: Jongmin Choi <jminl.choi@samsung.com>
Reviewed-by: Jongsung Lee <js126.lee@samsung.com>
(cherry picked from commit 73c1e373ddba4e748fc1466e352f812038a17b3e)
Reviewed-on: https://gerrit.iotivity.org/gerrit/14943

resource/csdk/security/provisioning/sample/sampleserver_justworks.cpp
resource/csdk/security/provisioning/sample/sampleserver_randompin.cpp
resource/csdk/security/provisioning/src/multipleownershiptransfermanager.c
resource/csdk/security/provisioning/src/ownershiptransfermanager.c
resource/csdk/security/provisioning/unittest/sampleserver1.cpp
resource/csdk/security/provisioning/unittest/sampleserver2.cpp

index fcf752d..94d79d0 100644 (file)
@@ -278,7 +278,7 @@ OCEntityHandlerResult ProcessPostRequest (OCEntityHandlerRequest *ehRequest,
                 gLedInstance[gCurrLedInstance].state = 0;
                 gLedInstance[gCurrLedInstance].power = 0;
                 gCurrLedInstance++;
-                strncpy ((char *)response->resourceUri, newLedUri, MAX_URI_LENGTH);
+                strncpy ((char *)response->resourceUri, newLedUri, sizeof(response->resourceUri));
                 ehResult = OC_EH_RESOURCE_CREATED;
             }
         }
index dc10ede..81b07c4 100644 (file)
@@ -314,7 +314,7 @@ OCEntityHandlerResult ProcessPostRequest (OCEntityHandlerRequest *ehRequest,
                 gLedInstance[gCurrLedInstance].state = 0;
                 gLedInstance[gCurrLedInstance].power = 0;
                 gCurrLedInstance++;
-                strncpy ((char *)response->resourceUri, newLedUri, MAX_URI_LENGTH);
+                strncpy ((char *)response->resourceUri, newLedUri, sizeof(response->resourceUri));
                 ehResult = OC_EH_RESOURCE_CREATED;
             }
         }
index 1206fa1..6a84d27 100644 (file)
@@ -541,7 +541,10 @@ static void SetMOTResult(OTMContext_t* motCtx, const OCStackResult res)
         //If there is a request being performed, cancel it to prevent retransmission.
         if(motCtx->ocDoHandle)
         {
-            OCCancel(motCtx->ocDoHandle, OC_HIGH_QOS, NULL, 0);
+            if (OC_STACK_OK !=  OCCancel(motCtx->ocDoHandle, OC_HIGH_QOS, NULL, 0))
+            {
+                OIC_LOG(ERROR, TAG, "Failed to remove registered callback");
+            }
             motCtx->ocDoHandle = NULL;
         }
 
index 5a06faf..9e7f9ce 100644 (file)
@@ -1898,11 +1898,6 @@ OCStackResult OTMDoOwnershipTransfer(void* ctx,
 
     OIC_LOG(DEBUG, TAG, "OUT OTMDoOwnershipTransfer");
     return OC_STACK_OK;
-
-error:
-    OICFree(otmCtx->ctxResultArray);
-    OICFree(otmCtx);
-    return res;
 }
 
 OCStackResult OTMSetOxmAllowStatus(const OicSecOxm_t oxm, const bool allowStatus)
index 7575811..5b1fc82 100644 (file)
@@ -345,7 +345,7 @@ OCEntityHandlerResult ProcessPostRequest (OCEntityHandlerRequest *ehRequest,
                 gLedInstance[gCurrLedInstance].state = 0;
                 gLedInstance[gCurrLedInstance].power = 0;
                 gCurrLedInstance++;
-                strncpy ((char *)response->resourceUri, newLedUri, MAX_URI_LENGTH);
+                strncpy ((char *)response->resourceUri, newLedUri, sizeof(response->resourceUri));
                 ehResult = OC_EH_RESOURCE_CREATED;
             }
         }
index 73440e6..bb70573 100644 (file)
@@ -345,7 +345,7 @@ OCEntityHandlerResult ProcessPostRequest (OCEntityHandlerRequest *ehRequest,
                 gLedInstance[gCurrLedInstance].state = 0;
                 gLedInstance[gCurrLedInstance].power = 0;
                 gCurrLedInstance++;
-                strncpy ((char *)response->resourceUri, newLedUri, MAX_URI_LENGTH);
+                strncpy ((char *)response->resourceUri, newLedUri, sizeof(response->resourceUri));
                 ehResult = OC_EH_RESOURCE_CREATED;
             }
         }