Commit aec43094 authored by Vitalii Irkha's avatar Vitalii Irkha

Check dataLen in CAdecryptSsl() API

Check dataLen before read data from TLS connection

Change-Id: I49fb13c620f8e6d08ea2a84767ab74e30d29292b
Signed-off-by: default avatarVitalii Irkha <v.irkha@samsung.com>
parent ef30103b
......@@ -2261,6 +2261,12 @@ CAResult_t CAdecryptSsl(const CASecureEndpoint_t *sep, uint8_t *data, size_t dat
VERIFY_NON_NULL_RET(sep, NET_SSL_TAG, "endpoint is NULL" , CA_STATUS_INVALID_PARAM);
VERIFY_NON_NULL_RET(data, NET_SSL_TAG, "Param data is NULL" , CA_STATUS_INVALID_PARAM);
if (0 == dataLen)
{
OIC_LOG(ERROR, NET_SSL_TAG, "dataLen is zero");
return CA_STATUS_FAILED;
}
oc_mutex_lock(g_sslContextMutex);
if (NULL == g_caSslContext)
{
......
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