提交 6d8a94e6 编写于 作者: C Chen Gang 提交者: Greg Kroah-Hartman

staging: sep: using strlcpy instead of strncpy

  set '\0' at tail for NUL terminated string, or TP_printk may cause issue.
Signed-off-by: NChen Gang <gang.chen@asianux.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 acb84e9e
......@@ -52,6 +52,11 @@
*/
#include <linux/tracepoint.h>
/*
* Since use str*cpy in header file, better to include string.h, directly.
*/
#include <linux/string.h>
/*
* The TRACE_EVENT macro is broken up into 5 parts.
*
......@@ -97,7 +102,7 @@ TRACE_EVENT(sep_func_start,
),
TP_fast_assign(
strncpy(__entry->name, name, 20);
strlcpy(__entry->name, name, 20);
__entry->branch = branch;
),
......@@ -116,7 +121,7 @@ TRACE_EVENT(sep_func_end,
),
TP_fast_assign(
strncpy(__entry->name, name, 20);
strlcpy(__entry->name, name, 20);
__entry->branch = branch;
),
......@@ -135,7 +140,7 @@ TRACE_EVENT(sep_misc_event,
),
TP_fast_assign(
strncpy(__entry->name, name, 20);
strlcpy(__entry->name, name, 20);
__entry->branch = branch;
),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册