Commit 1fce457b authored by saurabh.s9's avatar saurabh.s9 Committed by Randeep

[IOT-1701] Added check for int overflow

Change-Id: I5b613534ab19344a5d261f0773df52c4d9bb2176
Signed-off-by: default avatarsaurabh.s9 <saurabh.s9@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17111Tested-by: default avatarjenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: default avatarPawel Winogrodzki <pawelwi@microsoft.com>
Reviewed-by: default avatarPhil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Randeep's avatarRandeep Singh <randeep.s@samsung.com>
parent 413ba33b
......@@ -600,6 +600,11 @@ static int RecvCallBack(void * tep, unsigned char * data, size_t dataLen)
size_t retLen = (recBuf->len > recBuf->loaded ? recBuf->len - recBuf->loaded : 0);
retLen = (retLen < dataLen ? retLen : dataLen);
if (retLen > INT_MAX)
{
return 0;
}
memcpy(data, recBuf->buff + recBuf->loaded, retLen);
recBuf->loaded += retLen;
......
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