aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Gang <gang.chen@asianux.com>2013-04-08 00:12:39 -0400
committerIngo Molnar <mingo@kernel.org>2013-04-08 07:26:56 -0400
commit75761cc15877c155b3849b4e0e0cb3f897faf471 (patch)
tree8ba53195b51c031314c7454720af9d03ee9ec8f3
parent67012ab1d2ce871afea4ee55408f233f97d09d07 (diff)
ftrace: Fix strncpy() use, use strlcpy() instead of strncpy()
For NUL terminated string we always need to set '\0' at the end. Signed-off-by: Chen Gang <gang.chen@asianux.com> Cc: rostedt@goodmis.org Cc: Frederic Weisbecker <fweisbec@gmail.com> Link: http://lkml.kernel.org/r/516243B7.9020405@asianux.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--kernel/trace/ftrace.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 6893d5a2bf08..db143742704b 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -3441,14 +3441,14 @@ static char ftrace_filter_buf[FTRACE_FILTER_SIZE] __initdata;
3441 3441
3442static int __init set_ftrace_notrace(char *str) 3442static int __init set_ftrace_notrace(char *str)
3443{ 3443{
3444 strncpy(ftrace_notrace_buf, str, FTRACE_FILTER_SIZE); 3444 strlcpy(ftrace_notrace_buf, str, FTRACE_FILTER_SIZE);
3445 return 1; 3445 return 1;
3446} 3446}
3447__setup("ftrace_notrace=", set_ftrace_notrace); 3447__setup("ftrace_notrace=", set_ftrace_notrace);
3448 3448
3449static int __init set_ftrace_filter(char *str) 3449static int __init set_ftrace_filter(char *str)
3450{ 3450{
3451 strncpy(ftrace_filter_buf, str, FTRACE_FILTER_SIZE); 3451 strlcpy(ftrace_filter_buf, str, FTRACE_FILTER_SIZE);
3452 return 1; 3452 return 1;
3453} 3453}
3454__setup("ftrace_filter=", set_ftrace_filter); 3454__setup("ftrace_filter=", set_ftrace_filter);