Netdev List
 help / color / mirror / Atom feed
* [PATCH 1/5] net: ipv4: using strlcpy instead of strncpy
@ 2013-06-20 10:49 Zhao Hongjiang
  2013-06-20 10:49 ` [PATCH 2/5] net: netfilter: " Zhao Hongjiang
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Zhao Hongjiang @ 2013-06-20 10:49 UTC (permalink / raw)
  To: davem; +Cc: kuznet, jmorris, yoshfuji, kaber, netdev, Zhao Hongjiang

for NUL terminated string, need alway set '\0' in the end.

Signed-off-by: Zhao Hongjiang <zhaohongjiang@huawei.com>
---
 net/ipv4/tcp_cong.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/tcp_cong.c b/net/ipv4/tcp_cong.c
index 019c238..3280234 100644
--- a/net/ipv4/tcp_cong.c
+++ b/net/ipv4/tcp_cong.c
@@ -170,7 +170,7 @@ void tcp_get_default_congestion_control(char *name)
 
 	rcu_read_lock();
 	ca = list_entry(tcp_cong_list.next, struct tcp_congestion_ops, list);
-	strncpy(name, ca->name, TCP_CA_NAME_MAX);
+	strlcpy(name, ca->name, sizeof(name));
 	rcu_read_unlock();
 }
 
-- 
1.7.1

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

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

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-20 10:49 [PATCH 1/5] net: ipv4: using strlcpy instead of strncpy Zhao Hongjiang
2013-06-20 10:49 ` [PATCH 2/5] net: netfilter: " Zhao Hongjiang
2013-06-20 10:49 ` [PATCH 3/5] net: 8021q: " Zhao Hongjiang
2013-06-20 10:49 ` [PATCH 4/5] net: irda: " Zhao Hongjiang
2013-06-20 10:49 ` [PATCH 5/5] net: bluetooth: " Zhao Hongjiang
2013-06-20 11:17 ` [PATCH 1/5] net: ipv4: " David Laight
2013-06-20 12:14 ` Eric Dumazet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox