From: Andrew Morton <akpm@digeo.com>
To: ryan <ryan@ryanflynn.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] 2.5.56 sound/oss/sb_mixer.c bounds check
Date: Tue, 14 Jan 2003 19:30:00 -0800 [thread overview]
Message-ID: <200301141930.00567.akpm@digeo.com> (raw)
In-Reply-To: <3E24D1D5.5090200@ryanflynn.com>
On Tue January 14 2003 19:13, ryan wrote:
>
> diff -urN a/sound/oss/sb_mixer.c b/sound/oss/sb_mixer.c
> --- a/sound/oss/sb_mixer.c Fri Jan 10 15:11:27 2003
> +++ b/sound/oss/sb_mixer.c Tue Jan 14 22:06:20 2003
> @@ -333,6 +333,9 @@
> break;
>
> default:
> + /* bounds check */
> + if (dev >= sizeof(smw_mix_regs))
> + return -EINVAL;
> reg = smw_mix_regs[dev];
> if (reg == 0)
> return -EINVAL;
Yup.
It would be better to do:
if (dev < 0 || dev >= ARRAY_SIZE(smw_mix_regs))
next prev parent reply other threads:[~2003-01-15 3:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-15 3:13 [PATCH] 2.5.56 sound/oss/sb_mixer.c bounds check ryan
2003-01-15 3:30 ` Andrew Morton [this message]
2003-01-15 4:21 ` ryan
2003-01-15 4:36 ` Andrew Morton
2003-01-15 5:34 ` (OT) " Bruce Harada
2003-01-15 6:44 ` Andrew Morton
2003-01-15 4:37 ` ryan
-- strict thread matches above, loose matches on Subject: below --
2003-01-15 5:05 Perez-Gonzalez, Inaky
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=200301141930.00567.akpm@digeo.com \
--to=akpm@digeo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ryan@ryanflynn.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