From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54950) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtmDl-0000XH-ES for qemu-devel@nongnu.org; Fri, 11 Jan 2013 16:33:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TtmDg-00063z-NH for qemu-devel@nongnu.org; Fri, 11 Jan 2013 16:33:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:6097) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtmDg-00063r-FT for qemu-devel@nongnu.org; Fri, 11 Jan 2013 16:32:56 -0500 Message-ID: <50F08500.3050909@redhat.com> Date: Fri, 11 Jan 2013 14:32:48 -0700 From: Eric Blake MIME-Version: 1.0 References: <1357928108-21066-1-git-send-email-ehabkost@redhat.com> <1357928108-21066-7-git-send-email-ehabkost@redhat.com> In-Reply-To: <1357928108-21066-7-git-send-email-ehabkost@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig464CAECC304C38F3138E6477" Subject: Re: [Qemu-devel] [libvirt] [PATCH 06/10] vl.c: handle invalid NUMA CPU ranges properly List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: libvir-list@redhat.com, Chegu Vinod , qemu-devel@nongnu.org, Anthony Liguori This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig464CAECC304C38F3138E6477 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 01/11/2013 11:15 AM, Eduardo Habkost wrote: > Add checks for the following cases: >=20 > * Empty string: will be ignored and won't set any CPU bitmap, > parser won't abort. > * Missing end value after "-": parser will abort. > * Extra characters after a valid CPU range: parser will abort. > * "N-M" string where M < N: parser will abort. > value =3D strtoull(cpus, &endptr, 10); > if (*endptr =3D=3D '-') { > - endvalue =3D strtoull(endptr+1, &endptr, 10); > + endptr++; > + if (!*endptr) { > + goto error; > + } > + endvalue =3D strtoull(endptr, &endptr, 10); > } else { > endvalue =3D value; > } Still missing a check for '-numa=3D-2' with no number on the left of '-',= as well as missing a check for overflow for -numa=3D999999999999999999999= 999 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig464CAECC304C38F3138E6477 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with undefined - http://www.enigmail.net/ iQEcBAEBCAAGBQJQ8IUAAAoJEKeha0olJ0NqKV8H+QF+yOXaz03Sky3tDFZ1k1Bb fbgOb8UHePD4RBqQNDpc9wdDPpg136/uQOAhdPNJP3fW4X9afNv5ljZ6HkzaPBp1 JY3nV51ARakkDW0sJAPzmSYykdVdR0XTWEebgXtNyzzI/H3rEla0ubECYRQMGhcW gDrQHMN2OSQK9EFsAGpUuyBJJKxxpc8xu/EXUL1hJcCSBTyni9AbvABHg9vraEcz C9n3GAPkmdTku5AimSqTUVcSbnGgOswKYJD9BOxo7ScG9BDc8TT4silgynU+yVq7 HcT39YOItHfYqQtAXCzozoj1h52BsQiqHrqhmIQxBUCj8VKCK+Fea0KqEiKyz68= =bnYG -----END PGP SIGNATURE----- --------------enig464CAECC304C38F3138E6477--