From 789d5edc4c297f18cd532277d6be51b3e91a162e Mon Sep 17 00:00:00 2001 From: Parkhi Date: Thu, 23 Mar 2017 11:22:17 +0900 Subject: [PATCH] Fix defects detected by static code analyzer - When using the strncpy function, modified it to include a null termination Change-Id: Ibb47c2737c13558e5d18f809673300d2f8a0e8a7 Signed-off-by: Parkhi Reviewed-on: https://gerrit.iotivity.org/gerrit/18107 Tested-by: jenkins-iotivity Reviewed-by: Jihun Ha Reviewed-by: Uze Choi --- service/easy-setup/sampleapp/enrollee/linux/enrolleewifi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/easy-setup/sampleapp/enrollee/linux/enrolleewifi.c b/service/easy-setup/sampleapp/enrollee/linux/enrolleewifi.c index 1ce5629..3c35fee 100755 --- a/service/easy-setup/sampleapp/enrollee/linux/enrolleewifi.c +++ b/service/easy-setup/sampleapp/enrollee/linux/enrolleewifi.c @@ -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) -- 2.7.4