Re: [PATCH 2.6]: IPv6: strcpy -> strlcpy

4 messages, 3 authors, 2003-11-27 · open the first message on its own page

Re: [PATCH 2.6]: IPv6: strcpy -> strlcpy

From: YOSHIFUJI Hideaki / 吉藤英明 <hidden>
Date: 2003-11-27 08:33:24

In article [off-list ref] (at Thu, 27 Nov 2003 09:14:44 +0100), Felipe Alfaro Solana [off-list ref] says:
Attached is a patch against 2.6.0-test11 to convert all strcpy() calls
to their corresponding strlcpy() for IPv6. Compiled and tested.
I don't like this coding style.

diff -uNr linux-2.6.0-test11.orig/net/ipv6/ip6_tunnel.c linux-2.6.0-test11/net/ipv6/ip6_tunnel.c
--- linux-2.6.0-test11.orig/net/ipv6/ip6_tunnel.c	2003-11-26 21:42:56.000000000 +0100
+++ linux-2.6.0-test11/net/ipv6/ip6_tunnel.c	2003-11-27 00:27:09.000000000 +0100
-	strcpy(t->parms.name, dev->name);
+	strlcpy(t->parms.name, dev->name, IFNAMSIZ);
                                          sizeof(t->parms.name)
or something like that.

--yoshfuji

Re: [PATCH 2.6]: IPv6: strcpy -> strlcpy

From: David S. Miller <hidden>
Date: 2003-11-27 11:00:29

On Thu, 27 Nov 2003 17:33:20 +0900 (JST)
YOSHIFUJI Hideaki / _$B5HF#1QL@ [off-list ref] wrote:
-	strcpy(t->parms.name, dev->name);
+	strlcpy(t->parms.name, dev->name, IFNAMSIZ);
                                          sizeof(t->parms.name)

or something like that.
I agree, using sizeof() is the less error prone way of
doing things like this.

Felipe could you please rewrite your patch like this?

Thank you.

Re: [PATCH 2.6]: IPv6: strcpy -> strlcpy

From: Felipe Alfaro Solana <hidden>
Date: 2003-11-27 12:04:31

On Thu, 2003-11-27 at 11:59, David S. Miller wrote:
I agree, using sizeof() is the less error prone way of
doing things like this.

Felipe could you please rewrite your patch like this?
Done!

Re: [PATCH 2.6]: IPv6: strcpy -> strlcpy

From: YOSHIFUJI Hideaki / 吉藤英明 <hidden>
Date: 2003-11-27 12:09:50

In article [off-list ref] (at Thu, 27 Nov 2003 13:04:04 +0100), Felipe Alfaro Solana [off-list ref] says:
On Thu, 2003-11-27 at 11:59, David S. Miller wrote:
quoted
I agree, using sizeof() is the less error prone way of
doing things like this.

Felipe could you please rewrite your patch like this?
Done!
Thanks. Ok to me.
--yoshfuji
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help