[CONPRO-1305] Fix for SVACE issue.
1. Add condition to stop receive negative value.
2. Check condition for thread creation successful.
3. Check return value of function.
4. Update type mismatch value assigned.
https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/326
(cherry picked from commit
cb27ef5e3947ffc529630e0792eff21f4d081f12)
Change-Id: I44aca78703df3fbbe61bd0772760df22fd6c3db9
Signed-off-by: Amit KS <amit.s12@samsung.com>
uint32_t dataLen = 0;
if (g_mtuSize > totalLength)
{
- length = totalLength;
+ length = (uint32_t)totalLength;
dataLen = bleData->dataLen;
}
else
uint32_t dataLen = 0;
if (g_mtuSize > totalLength)
{
- length = totalLength;
+ length = (uint32_t)totalLength;
dataLen = bleData->dataLen;
}
else
}
CAResult_t res = CA_STATUS_FAILED;
- size_t resSize = 0;
+ uint32_t resSize = 0;
for (uint32_t index = 0; index < g_numberOfAdapters; index++)
{
if (g_adapterHandler[index].GetnetInfo != NULL)
}
}
- OIC_LOG_V(DEBUG, TAG, "network info total size is %zu!", resSize);
+ OIC_LOG_V(DEBUG, TAG, "network info total size is %" PRIu32, resSize);
if (resSize == 0)
{
CLOSE_SOCKET(ipv6s);
#endif
- close(caglobals.tcp.connectionFds[1]);
- close(caglobals.tcp.connectionFds[0]);
- caglobals.tcp.connectionFds[1] = OC_INVALID_SOCKET;
- caglobals.tcp.connectionFds[0] = OC_INVALID_SOCKET;
+ if (caglobals.tcp.connectionFds[1] != OC_INVALID_SOCKET)
+ {
+ close(caglobals.tcp.connectionFds[1]);
+ caglobals.tcp.connectionFds[1] = OC_INVALID_SOCKET;
+ }
+ if (caglobals.tcp.connectionFds[0] != OC_INVALID_SOCKET)
+ {
+ close(caglobals.tcp.connectionFds[0]);
+ caglobals.tcp.connectionFds[0] = OC_INVALID_SOCKET;
+ }
#ifndef __TIZENRT__
if (caglobals.tcp.shutdownFds[1] != OC_INVALID_SOCKET)
{
}
rewind(fp);
fsize = fread(trustCertChainArray.data, 1, fsize, fp);
- if(0 == fsize)
+ if (0 == fsize && ferror(fp))
{
OIC_LOG(ERROR,TAG,"Read error");
}
}
else
{
+ delete context;
oclog() <<"Can not convert struuid to uuid";
}
}
ns_pthread_create(&NSThread[i], NSTopicSchedule, NULL, "IoT_NS_TopicSchedule",
CONFIG_IOTIVITY_NS_TOPICSCHED_PTHREAD_STACKSIZE);
#else
- pthread_create(&NSThread[i], NULL, NSTopicSchedule, NULL);
+ if (pthread_create(&NSThread[i], NULL, NSTopicSchedule, NULL) != 0)
+ {
+ NS_LOG(ERROR, "Unable to create the NSThread");
+ return false;
+ }
#endif
}
break;