[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20110315144820.72435a14@nehalam>
Date: Tue, 15 Mar 2011 14:48:20 -0700
From: Stephen Hemminger <shemminger@...tta.com>
To: Sasikanth V <sasikanth.v19@...il.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [PATCH] Fix overflow of name in struct net_device, replaced
sprintf with snprintf.
On Wed, 16 Mar 2011 01:30:08 +0530
Sasikanth V <sasikanth.v19@...il.com> wrote:
>
> Signed-off-by: Sasikanth V <sasikanth.v19@...il.com>
> ---
> net/core/dev.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 6561021..a74efa9 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -539,7 +539,7 @@ unsigned long netdev_boot_base(const char *prefix, int unit)
> char name[IFNAMSIZ];
> int i;
>
> - sprintf(name, "%s%d", prefix, unit);
> + snprintf(name, IFNAMSIZ, "%s%d", prefix, unit);
>
> /*
> * If device already registered then return base of 1
that code is only called with a really small values "eth" and "tr" so
it is really not necessary. The whole drivers/net/Space.c code is totally
legacy and should eventually be eliminated anyway.
--
--
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