diff options
author | Chen Gang <gang.chen@asianux.com> | 2013-04-08 06:06:44 +0200 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2013-04-09 17:25:08 +0200 |
commit | 9607a869ee59594f3f7b9f3ac43a11d92bf3f960 (patch) | |
tree | 18dcec81e889275f3003535f9f2e96cdb7f50298 /kernel/trace/ftrace.c | |
parent | tracing: Update debugfs README file (diff) | |
download | linux-9607a869ee59594f3f7b9f3ac43a11d92bf3f960.tar.xz linux-9607a869ee59594f3f7b9f3ac43a11d92bf3f960.zip |
kernel: tracing: Use strlcpy instead of strncpy
Use strlcpy() instead of strncpy() as it will always add a '\0'
to the end of the string even if the buffer is smaller than what
is being copied.
Link: http://lkml.kernel.org/r/51624254.30301@asianux.com
Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r-- | kernel/trace/ftrace.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 25770824598f..548a1f7ea2c1 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -3496,14 +3496,14 @@ static char ftrace_filter_buf[FTRACE_FILTER_SIZE] __initdata; static int __init set_ftrace_notrace(char *str) { - strncpy(ftrace_notrace_buf, str, FTRACE_FILTER_SIZE); + strlcpy(ftrace_notrace_buf, str, FTRACE_FILTER_SIZE); return 1; } __setup("ftrace_notrace=", set_ftrace_notrace); static int __init set_ftrace_filter(char *str) { - strncpy(ftrace_filter_buf, str, FTRACE_FILTER_SIZE); + strlcpy(ftrace_filter_buf, str, FTRACE_FILTER_SIZE); return 1; } __setup("ftrace_filter=", set_ftrace_filter); |