Fix defects detected by static code analyzer
authorParkhi <h_w.park@samsung.com>
Thu, 23 Mar 2017 02:22:17 +0000 (11:22 +0900)
committerUze Choi <uzchoi@samsung.com>
Thu, 23 Mar 2017 06:48:45 +0000 (06:48 +0000)
- When using the strncpy function, modified it to include a null termination

Change-Id: Ibb47c2737c13558e5d18f809673300d2f8a0e8a7
Signed-off-by: Parkhi <h_w.park@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18107
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Jihun Ha <jihun.ha@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/easy-setup/sampleapp/enrollee/linux/enrolleewifi.c

index 1ce5629..3c35fee 100755 (executable)
@@ -211,7 +211,7 @@ void SetDeviceInfo()
     char userValue_str[] = "user_str";
     g_userProperties.userValue_int = 0;
 
-    strncpy(g_userProperties.userValue_str, userValue_str, strlen(userValue_str));
+    strncpy(g_userProperties.userValue_str, userValue_str, strlen(userValue_str) + 1);
     SetUserProperties(&g_userProperties);
 
     if(ESSetDeviceProperty(&deviceProperty) == ES_ERROR)