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 05:27:16 +0000 (05:27 +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>
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 fcf752dda25481d1bb096431fe2e2f392d895252..94d79d0fc9279b97aca7b46401a691756729844d 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 dc10ede7820517c5bbc0a87167bf6554c06c52d6..81b07c40d505670f3c51cc08cf011b298223c9b2 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 1206fa1635d4d8f4248f9ed45402721353025ca2..6a84d2772b108a0a82a311f152303362a0e59b39 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 5a06faf22d047b2cb0baecca0c3c476e76d55f9f..9e7f9ce32924bacbef71b8b01617e526153eb1d2 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 75758116f4ce575161dfbf67d5e2a4125a2310c9..5b1fc82db061749691c0088be1e3c74339a80765 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 73440e6cd5b18b70d91ecd6f889d13688d85cd69..bb70573345506f1e48eb6ab155248fe067f6cb1f 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;
             }
         }