Commit 8945c0a2 authored by Ossama Othman's avatar Ossama Othman Committed by Sachin Agrawal

Addressed warnings that occurred when security was enabled.

Use memcpy() instead of OICStrcpyPartial() to copy remote endpoint
identity related binary data.  This addresses a pointer signedness
warning caused by a unsigned char* vs char* type mismatch.

Change-Id: I224d51439d57a0b86ae6ccb44aff5ece427459f8
Signed-off-by: default avatarOssama Othman <ossama.othman@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1384Tested-by: default avatarjenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: default avatarSachin Agrawal <sachin.agrawal@intel.com>
parent 6a031422
......@@ -83,7 +83,11 @@ static CAEndpoint_t *GetPeerInfo(const CAEndpoint_t *peer)
static CAResult_t CAAddIdToPeerInfoList(const char *peerAddr, uint32_t port,
const unsigned char *id, uint16_t id_length)
{
if(NULL == peerAddr || NULL == id || 0 == port || 0 == id_length)
if(NULL == peerAddr
|| NULL == id
|| 0 == port
|| 0 == id_length
|| CA_MAX_ENDPOINT_IDENTITY_LEN < id_length)
{
OIC_LOG(ERROR, NET_DTLS_TAG, "CAAddIdToPeerInfoList invalid parameters");
return CA_STATUS_INVALID_PARAM;
......@@ -98,7 +102,8 @@ static CAResult_t CAAddIdToPeerInfoList(const char *peerAddr, uint32_t port,
OICStrcpy(peer->addr, sizeof(peer->addr), peerAddr);
peer->port = port;
OICStrcpyPartial(peer->identity.id, sizeof(peer->identity.id), id, id_length);
memcpy(peer->identity.id, id, id_length);
peer->identity.id_length = id_length;
if(NULL != GetPeerInfo(peer))
......
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