From: Zhao Hongjiang <zhaohongjiang@huawei.com>
To: <rostedt@goodmis.org>
Cc: <fweisbec@gmail.com>, <mingo@redhat.com>, <linux-kernel@vger.kernel.org>
Subject: [PATCH] trace: using strlcpy instead of strncpy
Date: Thu, 20 Jun 2013 19:07:17 +0800 [thread overview]
Message-ID: <51C2E265.9010209@huawei.com> (raw)
for NUL terminated string, need alway set '\0' in the end.
Signed-off-by: Zhao Hongjiang <zhaohongjiang@huawei.com>
---
include/trace/events/sock.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/trace/events/sock.h b/include/trace/events/sock.h
index 779abb9..333d8b5 100644
--- a/include/trace/events/sock.h
+++ b/include/trace/events/sock.h
@@ -44,7 +44,7 @@ TRACE_EVENT(sock_exceed_buf_limit,
),
TP_fast_assign(
- strncpy(__entry->name, prot->name, 32);
+ strlcpy(__entry->name, prot->name, 32);
__entry->sysctl_mem = prot->sysctl_mem;
__entry->allocated = allocated;
__entry->sysctl_rmem = prot->sysctl_rmem[0];
--
1.7.1
next reply other threads:[~2013-06-20 11:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-20 11:07 Zhao Hongjiang [this message]
2013-06-20 12:20 ` [PATCH] trace: using strlcpy instead of strncpy Steven Rostedt
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=51C2E265.9010209@huawei.com \
--to=zhaohongjiang@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.