strncat usage fix 01/29501/3
authorOleksandr Dmytrenko <o.dmytrenko@samsung.com>
Wed, 15 May 2019 06:21:15 +0000 (09:21 +0300)
committerAleksey Volkov <a.volkov@samsung.com>
Mon, 20 May 2019 11:04:19 +0000 (11:04 +0000)
error: 'strncat' specified bound 1 equals source length

Change-Id: I7e58c93ba17a760b7434c25024c858ae0f634079
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
resource/csdk/stack/src/oicgroup.c

index 2e4e706..77ad97e 100644 (file)
@@ -757,7 +757,7 @@ OCStackResult BuildStringFromActionSet(OCActionSet* actionset, char** desc)
     {
         strncat(temp, actionset->actionsetName, strlen(actionset->actionsetName));
         remaining -= strlen(actionset->actionsetName);
-        strncat(temp, ACTION_DELIMITER, strlen(ACTION_DELIMITER));
+        strncat(temp, ACTION_DELIMITER, strlen(ACTION_DELIMITER) + 1);
         remaining--;
     }
     else
@@ -774,7 +774,7 @@ OCStackResult BuildStringFromActionSet(OCActionSet* actionset, char** desc)
         {
             strncat(temp, actionTypeStr, strlen(actionTypeStr));
             remaining -= strlen(actionTypeStr);
-            strncat(temp, ACTION_DELIMITER, strlen(ACTION_DELIMITER));
+            strncat(temp, ACTION_DELIMITER, strlen(ACTION_DELIMITER) + 1);
             remaining -= strlen(ACTION_DELIMITER);
             OICFree(actionTypeStr);
         }