Compiler warning generated because the value of the size argument in
'strncat' is too large.
Also, IF check was not accounting for DELIMTER size, which
could cause overflow.
Change-Id: Iee3724bb08d8254f7a99f84ec1571eeeb5974d22
Signed-off-by: Charlie Lenahan <charlie.lenahan@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/678
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Mandeep Shetty <mandeep.shetty@intel.com>
Reviewed-by: Erich Keane <erich.keane@intel.com>
OCAction *action = actionset->head;
- if (remaining >= strlen(actionset->actionsetName) + 1)
+ if (remaining >= strlen(actionset->actionsetName) + (sizeof(ACTION_DELIMITER)-1) )
{
- strncat(temp, actionset->actionsetName, sizeof(temp));
+ strncat(temp, actionset->actionsetName, remaining);
remaining -= strlen(actionset->actionsetName);
strcat(temp, ACTION_DELIMITER);
- remaining--;
+ remaining -= (sizeof(ACTION_DELIMITER)-1);
}
else
{