change strcpy to strncpy.
authorjaesick.shin <jaesick.shin@samsung.com>
Fri, 2 Sep 2016 06:17:59 +0000 (15:17 +0900)
committerUze Choi <uzchoi@samsung.com>
Fri, 2 Sep 2016 09:30:44 +0000 (09:30 +0000)
strcpy function is unsafe.

Change-Id: Ifd679a4b9804861da409d4318b69502992d8ef90
Signed-off-by: jaesick.shin <jaesick.shin@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/11327
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
service/notification/unittest/NSProviderTest.cpp

index 671515a44d3190d297b51b1f7b10357d33d118bb..4c832bae51146980735b2375039064da41789669 100755 (executable)
@@ -123,9 +123,9 @@ protected:
 
             g_isStartedStack = true;
 
-            strcpy(g_title, "Title");
-            strcpy(g_body, "ContentText");
-            strcpy(g_sourceName, "OIC");
+            strncpy(g_title, "Title", strlen("Title"));
+            strncpy(g_body, "ContentText", strlen("ContentText"));
+            strncpy(g_sourceName, "OIC", strlen("OIC"));
         }
 
     }