All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH] net: Check network device driver name
Date: Fri, 26 Aug 2011 15:52:43 -0400	[thread overview]
Message-ID: <201108261552.44154.vapier@gentoo.org> (raw)
In-Reply-To: <1314363160-18362-2-git-send-email-monstr@monstr.eu>

On Friday, August 26, 2011 08:52:40 Michal Simek wrote:
> If name is longer than allocated space NAMESIZE
> mac address is rewritten which show error
> message like:

since you overflowed the buffer, who knows what could happen ...

> +	if (strlen(dev->name) > NAMESIZE) {
> +		printf("Long(%d>%d) network driver name for %s\n",
> +					strlen(dev->name), NAMESIZE, dev->name);
> +		return 0;
> +	}

size_t len = strlen(dev->name);
if (len >= NAMESIZE) {
	printf("network driver name is too long (%zu >= %zu): %s\n",
		len, NAMESIZE, dev->name);
	return -1;
}
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110826/44f59aee/attachment.pgp 

  reply	other threads:[~2011-08-26 19:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-26 12:52 [U-Boot] Device driver name - NET_MULTI Michal Simek
2011-08-26 12:52 ` [U-Boot] [RFC PATCH] net: Check network device driver name Michal Simek
2011-08-26 19:52   ` Mike Frysinger [this message]
2011-08-29  8:07     ` Michal Simek
2011-08-29 18:17       ` Mike Frysinger

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=201108261552.44154.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.