Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75761cc1 authored by Chen Gang's avatar Chen Gang Committed by Ingo Molnar
Browse files

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: default avatarChen 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: default avatarIngo Molnar <mingo@kernel.org>
parent 67012ab1
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -3441,14 +3441,14 @@ static char ftrace_filter_buf[FTRACE_FILTER_SIZE] __initdata;


static int __init set_ftrace_notrace(char *str)
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;
	return 1;
}
}
__setup("ftrace_notrace=", set_ftrace_notrace);
__setup("ftrace_notrace=", set_ftrace_notrace);


static int __init set_ftrace_filter(char *str)
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;
	return 1;
}
}
__setup("ftrace_filter=", set_ftrace_filter);
__setup("ftrace_filter=", set_ftrace_filter);