From: Michal Simek <monstr@monstr.eu>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH] net: Check network device driver name
Date: Mon, 29 Aug 2011 10:07:14 +0200 [thread overview]
Message-ID: <4E5B48B2.5070602@monstr.eu> (raw)
In-Reply-To: <201108261552.44154.vapier@gentoo.org>
Mike Frysinger wrote:
> 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;
> }
ok. I see it is 15 chars space + terminated characters.
Mike: Will you propose this patch or should I do it?
Thanks,
Michal
--
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
next prev parent reply other threads:[~2011-08-29 8:07 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
2011-08-29 8:07 ` Michal Simek [this message]
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=4E5B48B2.5070602@monstr.eu \
--to=monstr@monstr.eu \
--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.