diff options
author | Chen Gang <gang.chen@asianux.com> | 2013-02-17 11:53:15 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-11 09:15:32 -0700 |
commit | 6d8a94e67f0448f11279eee27d3b0ede06ba07d7 (patch) | |
tree | 55b8e57a7dcbdc53b3715da506c96cedef48d553 /drivers/staging/sep | |
parent | acb84e9ec213a51578a00cdf14650610c174ef9b (diff) | |
download | linux-6d8a94e67f0448f11279eee27d3b0ede06ba07d7.tar.bz2 |
staging: sep: using strlcpy instead of strncpy
set '\0' at tail for NUL terminated string, or TP_printk may cause issue.
Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/sep')
-rw-r--r-- | drivers/staging/sep/sep_trace_events.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/staging/sep/sep_trace_events.h b/drivers/staging/sep/sep_trace_events.h index 2b053a93afe6..74f4c9a2b5be 100644 --- a/drivers/staging/sep/sep_trace_events.h +++ b/drivers/staging/sep/sep_trace_events.h @@ -53,6 +53,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. * * name: name of the trace point. This is also how to enable the tracepoint. @@ -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; ), |