From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47993) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvY8a-0007XV-IZ for qemu-devel@nongnu.org; Wed, 16 Jan 2013 13:55:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvY8X-0007lt-4n for qemu-devel@nongnu.org; Wed, 16 Jan 2013 13:55:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:20253) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvY8W-0007ln-Rp for qemu-devel@nongnu.org; Wed, 16 Jan 2013 13:54:57 -0500 Message-ID: <50F6EAB1.8030307@redhat.com> Date: Wed, 16 Jan 2013 11:00:17 -0700 From: Eric Blake MIME-Version: 1.0 References: <1358349851-20960-1-git-send-email-ehabkost@redhat.com> <1358349851-20960-3-git-send-email-ehabkost@redhat.com> In-Reply-To: <1358349851-20960-3-git-send-email-ehabkost@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2QUQFCOTRQDVRWUUHEUAP" Subject: Re: [Qemu-devel] [PATCH 2/8] vl.c: Fix off-by-one bug when handling "-numa node" argument List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: Chegu Vinod , qemu-devel@nongnu.org, Anthony Liguori This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2QUQFCOTRQDVRWUUHEUAP Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 01/16/2013 08:24 AM, Eduardo Habkost wrote: > The numa_add() code was unconditionally adding 1 to the get_opt_name() > return value, making it point after the end of the string if no ',' > separator is present. >=20 > Example of weird behavior caused by the bug: >=20 > $ qemu-img create -f qcow2 this-file-image-has,cpus=3D5,mem=3D1000,in= -its-name.qcow2 5G > Formatting 'this-file-image-has,cpus=3D5,mem=3D1000,in-its-name.qcow2= ', fmt=3Dqcow2 size=3D5368709120 encryption=3Doff cluster_size=3D65536 > $ ./x86_64-softmmu/qemu-system-x86_64 -S -monitor stdio -numa node 't= his-file-image-has,cpus=3D5,mem=3D1000,in-its-name.qcow2' > QEMU 1.3.50 monitor - type 'help' for more information > (qemu) info numa > 1 nodes > node 0 cpus: 0 > node 0 size: 1000 MB > (qemu) >=20 > This changes the code to nove the pointer only if ',' is found. s/nove/move/ >=20 > Signed-off-by: Eduardo Habkost > --- > vl.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2QUQFCOTRQDVRWUUHEUAP 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 Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJQ9uqxAAoJEKeha0olJ0Nqr4sH/RB/dKmujIQ0SsmIucDs2kpM d+lTnN87PHJquqGk4WGmXT243KM4wP0EtNS0/C3sOA614k2rCmH0hjqHNV52ixQW w+ZR3VPvYWzm4C3ScuIWYdJ85FD22HPAMLUVxvAsBloOFWYwgFMIVSQvbvLSiUYP K0QNyoC8Vk38tHWtco/VLvLQyfd6Z09K3viKoUT2bW1feR6jIKhGiOYJdWnksXJJ k0BXBBIrx8mWWWI70yNUnGei4/gMSqvJDhhssnzVo2yKFTBSSTJAtfF2sUAUKi9d azHsdIZGm/YojWdJfQE1ozJuqgubnXUagSYNjLCg1wWWPO1DcBjRYFcsXc7ha68= =ZK1X -----END PGP SIGNATURE----- ------enig2QUQFCOTRQDVRWUUHEUAP--