All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] trace: using strlcpy instead of strncpy
@ 2013-06-20 11:07 Zhao Hongjiang
  2013-06-20 12:20 ` Steven Rostedt
  0 siblings, 1 reply; 2+ messages in thread
From: Zhao Hongjiang @ 2013-06-20 11:07 UTC (permalink / raw)
  To: rostedt; +Cc: fweisbec, mingo, linux-kernel

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] trace: using strlcpy instead of strncpy
  2013-06-20 11:07 [PATCH] trace: using strlcpy instead of strncpy Zhao Hongjiang
@ 2013-06-20 12:20 ` Steven Rostedt
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2013-06-20 12:20 UTC (permalink / raw)
  To: Zhao Hongjiang; +Cc: fweisbec, mingo, linux-kernel, David S. Miller, netdev

This fix is to a networking tracepoint. It should go through the
networking folks.

-- Steve


On Thu, 2013-06-20 at 19:07 +0800, Zhao Hongjiang wrote:
> 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];



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-20 12:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-20 11:07 [PATCH] trace: using strlcpy instead of strncpy Zhao Hongjiang
2013-06-20 12:20 ` Steven Rostedt

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.