netdev
[Top] [All Lists]

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

To: felipe_alfaro@xxxxxxxxxxxxx
Subject: Re: [PATCH 2.6]: IPv4: strcpy -> strlcpy
From: YOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@xxxxxxxxxxxxxx>
Date: Fri, 28 Nov 2003 11:05:25 +0900 (JST)
Cc: timo@xxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxx, davem@xxxxxxxxxx, yoshfuji@xxxxxxxxxxxxxx
In-reply-to: <1069970946.2138.13.camel@xxxxxxxxxxxxxxxxxxxxxxxx>
Organization: USAGI Project
References: <20031127142125.GG8276@xxxxxxxxxxxx> <3FC67128.14704.30155D53@localhost> <1069970946.2138.13.camel@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>