From: Dan Carpenter <error27@gmail.com>
To: Arend Van Spriel <arend@broadcom.com>
Cc: Vasanthakumar Thiagarajan <vasanth@atheros.com>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"ath9k-devel@lists.ath9k.org" <ath9k-devel@lists.ath9k.org>
Subject: Re: smatch stuff: potential read past the end of the buffer
Date: Mon, 20 Dec 2010 15:42:17 +0300 [thread overview]
Message-ID: <20101220124217.GU1936@bicker> (raw)
In-Reply-To: <400C43189542CE41BC0A5B252FC90136952F0594D7@SJEXCHCCR02.corp.ad.broadcom.com>
On Mon, Dec 20, 2010 at 02:16:56AM -0800, Arend Van Spriel wrote:
> Hi Dan,
>
> Why not use min() function?
> index = min(COMP_HDR_LEN + osize, 2046);
> mchecksum = word[index] |
> (word[index + 1] << 8);
>
> Or would smatch miss this in its analysis?
That would silence the warning, but is it the right fix? I thought
maybe we should make word a larger buffer?
regards,
dan carpenter
next prev parent reply other threads:[~2010-12-20 12:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-20 8:30 smatch stuff: potential read past the end of the buffer Dan Carpenter
2010-12-20 9:26 ` Senthil Balasubramanian
2010-12-20 10:16 ` Arend Van Spriel
2010-12-20 12:42 ` Dan Carpenter [this message]
2010-12-20 17:13 ` Arend Van Spriel
2010-12-21 7:29 ` Vasanthakumar Thiagarajan
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=20101220124217.GU1936@bicker \
--to=error27@gmail.com \
--cc=arend@broadcom.com \
--cc=ath9k-devel@lists.ath9k.org \
--cc=linux-wireless@vger.kernel.org \
--cc=vasanth@atheros.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;
as well as URLs for NNTP newsgroup(s).