From: David Henningsson <david.henningsson@canonical.com>
To: Clemens Ladisch <clemens@ladisch.de>
Cc: Takashi Iwai <tiwai@suse.de>,
ALSA Development Mailing List <alsa-devel@alsa-project.org>
Subject: Re: [PATCH] Fix possible sprintf overrun in snd_pcm_hw_open
Date: Wed, 08 Dec 2010 14:20:19 +0100 [thread overview]
Message-ID: <4CFF8613.5070606@canonical.com> (raw)
In-Reply-To: <4CFF8061.1040802@canonical.com>
On 2010-12-08 13:56, David Henningsson wrote:
> On 2010-12-08 13:12, Clemens Ladisch wrote:
>> David Henningsson wrote:
>>> Possible buffer overrun if the number of "card" and "device"
>>> are absurdly high, especially on 64-bit platforms.
>>
>> The size of "int" is 32 bits even on 64-bit platforms.
>
> Seems you're right, then I learned something new today :-)
>
> Although this might be compiler dependent, and some exotic platform
> might decide otherwise in the future?
>
>> As far as I can see, there is no bug.
>
> Even for 32-bit platforms, you would still overrun the buffer if you set
> card = device = −2147483647.
>
...or maybe not, forgot that the %d characters are removed. Oh well,
doesn't hurt to change it into snprintf anyway ;-)
--
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
prev parent reply other threads:[~2010-12-08 13:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-08 10:16 [PATCH] Fix possible sprintf overrun in snd_pcm_hw_open David Henningsson
2010-12-08 12:12 ` Clemens Ladisch
2010-12-08 12:56 ` David Henningsson
2010-12-08 13:20 ` David Henningsson [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=4CFF8613.5070606@canonical.com \
--to=david.henningsson@canonical.com \
--cc=alsa-devel@alsa-project.org \
--cc=clemens@ladisch.de \
--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