summaryrefslogtreecommitdiffstats
path: root/kernel/trace/ftrace.c
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2009-10-14 20:43:39 +0200
committerFrederic Weisbecker <fweisbec@gmail.com>2009-10-14 20:43:39 +0200
commit06f43d66ec36388056f5c697bf1e67c0e0a1645c (patch)
tree04b8735f670570d146c0c12bb403effc94e14346 /kernel/trace/ftrace.c
parent459c6d15a0c52bae43842ff2cd0dd41aa7de9b7f (diff)
ftrace: Copy ftrace_graph_filter boot param using strlcpy
We are using strncpy in the wrong way to copy the ftrace_graph_filter boot param because we pass the buffer size instead of the max string size it can contain (buffer size - 1). The end result might not be NULL terminated as we are abusing the max string size. Lets use strlcpy() instead. Reported-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r--kernel/trace/ftrace.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index aaea9cda878..b10c0d90a6f 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -2293,7 +2293,7 @@ __setup("ftrace_filter=", set_ftrace_filter);
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
static int __init set_graph_function(char *str)
{
- strncpy(ftrace_graph_buf, str, FTRACE_FILTER_SIZE);
+ strlcpy(ftrace_graph_buf, str, FTRACE_FILTER_SIZE);
return 1;
}
__setup("ftrace_graph_filter=", set_graph_function);