From: Adrian Bunk <bunk@stusta.de>
To: Roland Dreier <roland@topspin.com>
Cc: jgarzik@pobox.com, linux-net@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: drivers/net/at1700.c: at1700_probe1: array overflow
Date: Fri, 25 Mar 2005 21:38:20 +0100 [thread overview]
Message-ID: <20050325203820.GF3153@stusta.de> (raw)
In-Reply-To: <528y4b7ekc.fsf@topspin.com>
On Fri, Mar 25, 2005 at 10:42:11AM -0800, Roland Dreier wrote:
> Adrian> This can result in indexing in an array with 8 entries the
> Adrian> 10th entry.
>
> Well, not really, since the first 8 entries of the array have every
> 3-bit pattern. So pos3 & 0x07 will always match one of them.
>
> I agree it would be cleaner to make the loop only go up to 7 though.
You either have this (impossible) overflow, or the case l_i == 7 isn't
tested explicitely.
I'd say simply leave it as it is now.
But if noone disagrees, I'm inclined to add a comment.
> - R.
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
next prev parent reply other threads:[~2005-03-25 20:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-25 18:18 drivers/net/at1700.c: at1700_probe1: array overflow Adrian Bunk
2005-03-25 18:42 ` Roland Dreier
2005-03-25 20:38 ` Adrian Bunk [this message]
2005-03-30 0:49 ` null
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=20050325203820.GF3153@stusta.de \
--to=bunk@stusta.de \
--cc=jgarzik@pobox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-net@vger.kernel.org \
--cc=roland@topspin.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox