From: Eric Dumazet <eric.dumazet@gmail.com>
To: Zhao Hongjiang <zhaohongjiang@huawei.com>
Cc: davem@davemloft.net, kuznet@ms2.inr.ac.ru, jmorris@namei.org,
yoshfuji@linux-ipv6.org, kaber@trash.net, netdev@vger.kernel.org
Subject: Re: [PATCH 1/5] net: ipv4: using strlcpy instead of strncpy
Date: Thu, 20 Jun 2013 05:14:57 -0700 [thread overview]
Message-ID: <1371730497.3252.400.camel@edumazet-glaptop> (raw)
In-Reply-To: <1371725385-11540-1-git-send-email-zhaohongjiang@huawei.com>
On Thu, 2013-06-20 at 18:49 +0800, Zhao Hongjiang wrote:
> 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();
> }
>
You are quite mistaken.
How did you test this patch exactly ?
prev parent reply other threads:[~2013-06-20 12:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1371730497.3252.400.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=jmorris@namei.org \
--cc=kaber@trash.net \
--cc=kuznet@ms2.inr.ac.ru \
--cc=netdev@vger.kernel.org \
--cc=yoshfuji@linux-ipv6.org \
--cc=zhaohongjiang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox