From: "Clemens Ladisch" <clemens@ladisch.de>
To: "Jesper Juhl" <jj@chaosbits.net>, linux-kernel@vger.kernel.org
Cc: alsa-devel@alsa-project.org, "Takashi Iwai" <tiwai@suse.de>,
"Jaroslav Kysela" <perex@perex.cz>
Subject: Re: [PATCH][RFC] Sound, Xonar, CS43xx: Don't overrun static array
Date: Sat, 22 Jan 2011 14:55:08 +0100 [thread overview]
Message-ID: <1295704508.21026.1416646721@webmail.messagingengine.com> (raw)
In-Reply-To: <alpine.LNX.2.00.1101202228370.11854@swampdragon.chaosbits.net>
Jesper Juhl wrote:
> 'cs4398_regs' in 'struct xonar_cs43xx' is an array of 'u8' with a size of
> 8. So, this code in sound/pci/oxygen/xonar_cs43xx.c::dump_d1_registers()
>
> for (i = 2; i <= 8; ++i)
> snd_iprintf(buffer, " %02x", data->cs4398_regs[i]);
>
> will overrun the array when 'i == 8'.
>
> I guess that what's needed to fix it is the trivial patch below, but I
> must admit that I have no idea about this code, so I may very well be
> wrong. Additionally, I have no way to actually test this, so all I know is
> that the below compiles. Someone who actually knows this code should take
> a look before anything is comitted - consider the below (not much more
> than) a bug report.
>
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
> ---
> xonar_cs43xx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sound/pci/oxygen/xonar_cs43xx.c
> b/sound/pci/oxygen/xonar_cs43xx.c
> index 9f72d42..2527191 100644
> --- a/sound/pci/oxygen/xonar_cs43xx.c
> +++ b/sound/pci/oxygen/xonar_cs43xx.c
> @@ -392,7 +392,7 @@ static void dump_d1_registers(struct oxygen *chip,
> unsigned int i;
>
> snd_iprintf(buffer, "\nCS4398: 7?");
> - for (i = 2; i <= 8; ++i)
> + for (i = 2; i < 8; ++i)
> snd_iprintf(buffer, " %02x", data->cs4398_regs[i]);
> snd_iprintf(buffer, "\n");
> dump_cs4362a_registers(data, buffer);
next prev parent reply other threads:[~2011-01-22 13:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-20 21:37 [PATCH][RFC] Sound, Xonar, CS43xx: Don't overrun static array Jesper Juhl
2011-01-22 13:55 ` Clemens Ladisch [this message]
2011-01-22 16:24 ` Takashi Iwai
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=1295704508.21026.1416646721@webmail.messagingengine.com \
--to=clemens@ladisch.de \
--cc=alsa-devel@alsa-project.org \
--cc=jj@chaosbits.net \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox