From: Chen Gang <gang.chen@asianux.com>
To: rostedt@goodmis.org, Frederic Weisbecker <fweisbec@gmail.com>,
"mingo@redhat.com" <mingo@redhat.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH] kernel: trace: ftrace: strncpy, using strlcpy instead of strncpy
Date: Mon, 08 Apr 2013 12:12:39 +0800 [thread overview]
Message-ID: <516243B7.9020405@asianux.com> (raw)
for NUL terminated string, need always set '\0' at the end.
Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
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 dfd33f0..fa984b7 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -3492,14 +3492,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);
--
1.7.7.6
next reply other threads:[~2013-04-08 4:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-08 4:12 Chen Gang [this message]
2013-04-08 15:31 ` [tip:perf/urgent] ftrace: Fix strncpy() use, use strlcpy() instead of strncpy() tip-bot for Chen Gang
2013-04-09 1:38 ` Chen Gang
2013-04-09 15:00 ` [PATCH] kernel: trace: ftrace: strncpy, using strlcpy instead of strncpy Steven Rostedt
2013-04-10 6:25 ` Chen Gang F T
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=516243B7.9020405@asianux.com \
--to=gang.chen@asianux.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome