From: jungkon.kim Date: Wed, 6 Sep 2017 06:39:21 +0000 (+0900) Subject: Fix the string copy error X-Git-Tag: accepted/tizen/unified/20170907.060340^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1bce405ec00e58ed1449fb0e2656d18d162ef0cb;p=platform%2Fcore%2Fsecurity%2Fprivacy-guard.git Fix the string copy error Change-Id: If307b38556e0760b359264d4a3a87ff11abb4708 --- diff --git a/common/src/pg_strlcpy.c b/common/src/pg_strlcpy.c index d00139a..09b5200 100644 --- a/common/src/pg_strlcpy.c +++ b/common/src/pg_strlcpy.c @@ -31,7 +31,7 @@ void pg_strlcpy(char *dst, const char *src, size_t dstsize) return; } if (dstsize > 0) { - strncpy(dst, src, dstsize - 1); - dst[dstsize - 1] = '\0'; + strncpy(dst, src, dstsize); + dst[dstsize] = '\0'; } }