[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1371725385-11540-1-git-send-email-zhaohongjiang@huawei.com>
Date:	Thu, 20 Jun 2013 18:49:41 +0800
From:	Zhao Hongjiang <zhaohongjiang@...wei.com>
To:	<davem@...emloft.net>
CC:	<kuznet@....inr.ac.ru>, <jmorris@...ei.org>,
	<yoshfuji@...ux-ipv6.org>, <kaber@...sh.net>,
	<netdev@...r.kernel.org>, Zhao Hongjiang <zhaohongjiang@...wei.com>
Subject: [PATCH 1/5] net: ipv4: using strlcpy instead of strncpy
for NUL terminated string, need alway set '\0' in the end.
Signed-off-by: Zhao Hongjiang <zhaohongjiang@...wei.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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists
 
