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
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;
}
}
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;
}
}
//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;
}
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)
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;
}
}
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;
}
}