From: Chen Gang Date: Sun, 26 May 2013 06:54:34 +0000 (+0800) Subject: arch: arm: mach-msm: using strlcpy instead of strncpy X-Git-Tag: v3.11-rc1~149^2~1^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ad8c373c9aa31d5fc56eb882ba0523d2d6d1e2f6;p=platform%2Fkernel%2Flinux-stable.git arch: arm: mach-msm: using strlcpy instead of strncpy For NULL terminated string, need always be sure of ended by zero. Or the next 'ptr' in 'for' looping may cause issue. Signed-off-by: Chen Gang Signed-off-by: David Brown --- diff --git a/arch/arm/mach-msm/clock-debug.c b/arch/arm/mach-msm/clock-debug.c index 4886404..b0fbdf1 100644 --- a/arch/arm/mach-msm/clock-debug.c +++ b/arch/arm/mach-msm/clock-debug.c @@ -104,7 +104,7 @@ int __init clock_debug_add(struct clk *clock) if (!debugfs_base) return -ENOMEM; - strncpy(temp, clock->dbg_name, ARRAY_SIZE(temp)-1); + strlcpy(temp, clock->dbg_name, ARRAY_SIZE(temp)); for (ptr = temp; *ptr; ptr++) *ptr = tolower(*ptr);