From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGRUv-0003Jc-BW for qemu-devel@nongnu.org; Thu, 20 Feb 2014 06:09:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGRUq-0001d4-GV for qemu-devel@nongnu.org; Thu, 20 Feb 2014 06:08:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:61975) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGRRx-00016b-QA for qemu-devel@nongnu.org; Thu, 20 Feb 2014 06:05:53 -0500 Date: Thu, 20 Feb 2014 12:05:47 +0100 From: Christophe Fergeau Message-ID: <20140220110546.GA8099@teriyaki.redhat.com> References: <1392806450-3452-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UugvWAfsgieZRqgk" Content-Disposition: inline In-Reply-To: <1392806450-3452-1-git-send-email-kraxel@redhat.com> Subject: Re: [Qemu-devel] [Spice-devel] [PATCH] qxl: add sanity check List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: spice-devel@lists.freedesktop.org, qemu-devel@nongnu.org --UugvWAfsgieZRqgk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Looks good, ACK. Christophe On Wed, Feb 19, 2014 at 11:40:50AM +0100, Gerd Hoffmann wrote: > Signed-off-by: Gerd Hoffmann > --- > hw/display/qxl.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) >=20 > diff --git a/hw/display/qxl.c b/hw/display/qxl.c > index 1471cc0..2a559eb 100644 > --- a/hw/display/qxl.c > +++ b/hw/display/qxl.c > @@ -1429,7 +1429,7 @@ static int qxl_destroy_primary(PCIQXLDevice *d, qxl= _async_io async) > return 1; > } > =20 > -static void qxl_set_mode(PCIQXLDevice *d, int modenr, int loadvm) > +static void qxl_set_mode(PCIQXLDevice *d, unsigned int modenr, int loadv= m) > { > pcibus_t start =3D d->pci.io_regions[QXL_RAM_RANGE_INDEX].addr; > pcibus_t end =3D d->pci.io_regions[QXL_RAM_RANGE_INDEX].size + sta= rt; > @@ -1439,6 +1439,12 @@ static void qxl_set_mode(PCIQXLDevice *d, int mode= nr, int loadvm) > .mem_start =3D start, > .mem_end =3D end > }; > + > + if (modenr >=3D d->modes->n_modes) { > + qxl_set_guest_bug(d, "mode number out of range"); > + return; > + } > + > QXLSurfaceCreate surface =3D { > .width =3D mode->x_res, > .height =3D mode->y_res, > --=20 > 1.8.3.1 >=20 > _______________________________________________ > Spice-devel mailing list > Spice-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/spice-devel --UugvWAfsgieZRqgk Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlMF4YoACgkQJKRp+3pW945lDwCfW9ID9MsoixYZg7RE2VHA9/SU GREAoJ/Ddkv/eM1TT34KU5n2uZy+nV/q =HrCs -----END PGP SIGNATURE----- --UugvWAfsgieZRqgk--