off-by-one in allocating memory for a string: was no space
for the null terminator since strlen() was used to compute size.
Change-Id: Ic7b836416f2a5319f2906be504fec09de29182dc
Signed-off-by: Mats Wichmann <mats@linux.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21917
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
OIC_LOG(ERROR, TAG, "Unable to parse JSON string");
goto exit;
}
- size = strlen(jsonStr);
+ size = strlen(jsonStr) + 1;
size_t bufferSize = 0;
buffer = (uint8_t *)OICMalloc(size);
if (!buffer)