From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:57450) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLZmB-0003CK-Qd for qemu-devel@nongnu.org; Wed, 02 Nov 2011 08:18:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RLZm6-000369-6J for qemu-devel@nongnu.org; Wed, 02 Nov 2011 08:18:39 -0400 Received: from cantor2.suse.de ([195.135.220.15]:47636 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLZm5-000340-UT for qemu-devel@nongnu.org; Wed, 02 Nov 2011 08:18:34 -0400 Message-ID: <4EB13516.1060801@suse.de> Date: Wed, 02 Nov 2011 13:18:30 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1320234974-15318-1-git-send-email-kraxel@redhat.com> In-Reply-To: <1320234974-15318-1-git-send-email-kraxel@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] intel-hda: fix stream search List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: marcandre.lureau@gmail.com, qemu-devel@nongnu.org Am 02.11.2011 12:56, schrieb Gerd Hoffmann: > commit ba43d28916c4f51c19bd7366089155ce81bee058 introduces a bug: > The stream-not-found case doesn't error out any more, instead the > code silently uses the first stream. Fix it. >=20 > Signed-off-by: Gerd Hoffmann > --- > hw/intel-hda.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) >=20 > diff --git a/hw/intel-hda.c b/hw/intel-hda.c > index 675b659..b7ec36d 100644 > --- a/hw/intel-hda.c > +++ b/hw/intel-hda.c > @@ -401,7 +401,7 @@ static bool intel_hda_xfer(HDACodecDevice *dev, uin= t32_t stnr, bool output, > break; > } > } > - if (st =3D=3D NULL) { > + if (s =3D=3D 4) { > return false; > } > if (st->bpl =3D=3D NULL) { The commit message doesn't say it clearly: Is st =3D=3D NULL impossible? If not, this introduces a potential NULL pointer dereference at st->bpl. Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg