From: Jaehyun Kim Date: Mon, 17 Feb 2020 12:52:00 +0000 (+0900) Subject: Replaced strncpy() with g_strlcpy() in helper-procfs.c X-Git-Tag: accepted/tizen/unified/20200227.121053^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=968e1a84eda591be4e85b02902e5455434be53bd;p=platform%2Fcore%2Fconnectivity%2Fstc-manager.git Replaced strncpy() with g_strlcpy() in helper-procfs.c strncpy doesn’t set zero byte implicitly. Change-Id: I45f322916017d2b727902e713284d0e8ffa19fad Signed-off-by: Jaehyun Kim --- diff --git a/src/helper/helper-procfs.c b/src/helper/helper-procfs.c index 60e5db2..a0d9f0e 100644 --- a/src/helper/helper-procfs.c +++ b/src/helper/helper-procfs.c @@ -259,7 +259,7 @@ API int proc_get_status(pid_t pid, char status[][PROC_BUF_MAX]) if (token != NULL) { while (isspace((unsigned char)*token)) token++; - strncpy(status[index], token, + g_strlcpy(status[index], token, sizeof(status[index])); updated[index] = TRUE; }