From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Ameen Ali <ameenali023@gmail.com>, grundler@parisc-linux.org
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 9/9] tulip_core.c : out-of-bounds check.
Date: Fri, 13 Mar 2015 21:41:21 +0300 [thread overview]
Message-ID: <55032F51.5090203@cogentembedded.com> (raw)
In-Reply-To: <1426256152-5522-1-git-send-email-ameenali023@gmail.com>
Hello.
On 03/13/2015 05:15 PM, Ameen Ali wrote:
> Array index 'j' is used before limits check.
> Suggest put limit check before index use.
> Signed-off-by : <Ameenali023@gmail.com>
> ---
> drivers/net/ethernet/dec/tulip/tulip_core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> diff --git a/drivers/net/ethernet/dec/tulip/tulip_core.c b/drivers/net/ethernet/dec/tulip/tulip_core.c
> index 3b42556..ed41559 100644
> --- a/drivers/net/ethernet/dec/tulip/tulip_core.c
> +++ b/drivers/net/ethernet/dec/tulip/tulip_core.c
> @@ -589,7 +589,7 @@ static void tulip_tx_timeout(struct net_device *dev)
> (unsigned int)tp->rx_ring[i].buffer1,
> (unsigned int)tp->rx_ring[i].buffer2,
> buf[0], buf[1], buf[2]);
> - for (j = 0; buf[j] != 0xee && j < 1600; j++)
> + for (j = 0; ((j < 1600) && buf[j] != 0xee); j++)
No need for extra parens, either around < or around &&.
WBR, Sergei
prev parent reply other threads:[~2015-03-13 18:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-13 14:15 [PATCH 9/9] tulip_core.c : out-of-bounds check Ameen Ali
2015-03-13 16:43 ` David Miller
2015-03-13 18:41 ` Sergei Shtylyov [this message]
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=55032F51.5090203@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=ameenali023@gmail.com \
--cc=grundler@parisc-linux.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).