From: Ossama Othman Date: Mon, 22 Jun 2015 16:50:30 +0000 (-0700) Subject: Addressed warnings that occurred when security was enabled. X-Git-Tag: 1.2.0+RC1~1573 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8945c0a25f9876281cd165da7cda1c4084183be2;p=platform%2Fupstream%2Fiotivity.git 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: Ossama Othman Reviewed-on: https://gerrit.iotivity.org/gerrit/1384 Tested-by: jenkins-iotivity Reviewed-by: Sachin Agrawal --- diff --git a/resource/csdk/connectivity/src/adapter_util/caadapternetdtls.c b/resource/csdk/connectivity/src/adapter_util/caadapternetdtls.c index 8d58aca..f49e3d5 100644 --- a/resource/csdk/connectivity/src/adapter_util/caadapternetdtls.c +++ b/resource/csdk/connectivity/src/adapter_util/caadapternetdtls.c @@ -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))