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

From: YOSHIFUJI Hideaki / 吉藤英明
Date: Thu Nov 27 2003 - 21:07:31 EST


In article <1069970946.2138.13.camel@xxxxxxxxxxxxxxxxxxxxxxxx> (at Thu, 27 Nov 2003 23:09:06 +0100), Felipe Alfaro Solana <felipe_alfaro@xxxxxxxxxxxxx> says:

> diff -uNr linux-2.6.0-test11.orig/net/ipv4/ipconfig.c linux-2.6.0-test11/net/ipv4/ipconfig.c
> --- linux-2.6.0-test11.orig/net/ipv4/ipconfig.c 2003-11-26 21:42:55.000000000 +0100
> +++ linux-2.6.0-test11/net/ipv4/ipconfig.c 2003-11-27 13:32:06.904650818 +0100
> @@ -299,7 +299,7 @@
> int err;
>
> memset(&ir, 0, sizeof(ir));
> - strcpy(ir.ifr_ifrn.ifrn_name, ic_dev->name);
> + strlcpy(ir.ifr_ifrn.ifrn_name, ic_dev->name, sizeof(ir.ifr_ifrn.ifrn_name));

please use
strlcpy(ir.ifr_name, ic_dev->name, sizeof(ir.ifr_name));
instead.

--yoshfuji
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/