Commit 115c61d4 authored by Iurii Metelytsia's avatar Iurii Metelytsia Committed by Aleksey

Static analyzer issues fixed

Change-Id: I175dd965aa0c4d85dd37d5d9b4ece9b4360ff05a
Signed-off-by: default avatarIurii Metelytsia <i.metelytsia@samsung.com>
parent d9bd15e5
......@@ -1508,6 +1508,7 @@ static int provisionCloudConfig(void)
int res = fread (cert, 1, certsize, F);
/* Set our own trust anchor so that we trust certs we've issued. */
res = OCSaveTrustCertChain((uint8_t*) cert, certsize, OIC_ENCODING_PEM, &g_caCredId);
free(cert);
if (OC_STACK_OK != res)
{
printf(" Failed to setup CA\n");
......
......@@ -400,7 +400,10 @@ static int sendGetLed(void)
return -1;
}
waitCallbackRet();
if (waitCallbackRet() != 0)
{
OIC_LOG(WARNING, TAG, "waitCallbackRet failed");
}
}
else
{
......
......@@ -236,19 +236,22 @@ static OCEntityHandlerResult HandleCloudPostRequest(OCEntityHandlerRequest *ehRe
{
// find the interface name from UDP address of sender
percentChar = strchr(ehRequest->devAddr.addr, '%');
size_t ifLen = strlen(percentChar);
size_t addrLen = strlen(newCloud->cis);
size_t cisLen = addrLen + ifLen + 3;
// fill the cloud uri with interface name inserted
cis = (char *)OICMalloc(sizeof(char) * cisLen);
OICStrcpy(cis, ipv6End - newCloud->cis + 1, newCloud->cis);
OICStrcat(cis, cisLen, "%25");
OICStrcat(cis, cisLen, percentChar + 1);
OICStrcat(cis, cisLen, ipv6End);
OICFree(newCloud->cis);
newCloud->cis = cis;
if (NULL != percentChar)
{
size_t ifLen = strlen(percentChar);
size_t addrLen = strlen(newCloud->cis);
size_t cisLen = addrLen + ifLen + 3;
// fill the cloud uri with interface name inserted
cis = (char *)OICMalloc(sizeof(char) * cisLen);
OICStrcpy(cis, ipv6End - newCloud->cis + 1, newCloud->cis);
OICStrcat(cis, cisLen, "%25");
OICStrcat(cis, cisLen, percentChar + 1);
OICStrcat(cis, cisLen, ipv6End);
OICFree(newCloud->cis);
newCloud->cis = cis;
}
}
}
......
......@@ -591,7 +591,18 @@ static void SetResult(OTMContext_t* otmCtx, const OCStackResult res)
//If all OTM process is complete, invoke the user callback.
if(IsComplete(otmCtx))
{
SetDosState(DOS_RFNOP);
switch (SetDosState(DOS_RFNOP))
{
case OC_STACK_OK:
OIC_LOG(INFO, TAG, "DOS state SUCCESSFULLY changed to DOS_RFNOP.");
break;
case OC_STACK_FORBIDDEN_REQ:
OIC_LOG(WARNING, TAG, "DOS state change to DOS_RFNOP NOT ALLOWED.");
break;
default:
OIC_LOG(WARNING, TAG, "DOS state change to DOS_RFNOP FAILED.");
break;
}
otmCtx->ctxResultCallback(otmCtx->userCtx, otmCtx->ctxResultArraySize,
otmCtx->ctxResultArray, otmCtx->ctxHasError);
OICFree(otmCtx->ctxResultArray);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment