- In Caremotehandler.c, function CACloneInfo was copying token into buffer in vulnurable way
- Fixed it appending NULL in destination string
https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/662
(cherry-picked from
f8af2d6ca117bdf270c97c5c28f86bb0169659e5)
Change-Id: I84dfff77ecbf3a333913ce341060d7e30444ac62
Signed-off-by: samanway <samanway-dey@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
// allocate token field
uint8_t len = info->tokenLength;
- char *temp = (char *) OICMalloc(len * sizeof(char));
+ char *temp = (char *) OICCalloc(1, (len + 1) * sizeof(char));
if (!temp)
{
OIC_LOG(ERROR, TAG, "CACloneInfo Out of memory");