From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48430) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmUXk-00086B-4d for qemu-devel@nongnu.org; Wed, 14 Oct 2015 18:29:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZmUXg-0006p4-Sm for qemu-devel@nongnu.org; Wed, 14 Oct 2015 18:29:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37310) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmUXg-0006p0-Mv for qemu-devel@nongnu.org; Wed, 14 Oct 2015 18:29:04 -0400 References: <1444840229-26171-1-git-send-email-eblake@redhat.com> From: Eric Blake Message-ID: <561ED72A.8040805@redhat.com> Date: Wed, 14 Oct 2015 16:28:58 -0600 MIME-Version: 1.0 In-Reply-To: <1444840229-26171-1-git-send-email-eblake@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ow8XKpsfFnmqqPG3QAFD4piHPNUPpdrAL" Subject: Re: [Qemu-devel] [PATCH] qapi: Fix regression with '-netdev ?' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: marcandre.lureau@gmail.com, armbru@redhat.com, Michael Roth This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ow8XKpsfFnmqqPG3QAFD4piHPNUPpdrAL Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/14/2015 10:30 AM, Eric Blake wrote: > Commit e36c714e causes 'qemu -netdev ?' to dump core, because the > call to visit_end_union() is no longer conditional on whether > *obj was allocated. >=20 > Reported by Marc-Andr=C3=A9 Lureau > Signed-off-by: Eric Blake > --- > scripts/qapi-visit.py | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >=20 > diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py > index 9e99c3a..74748a2 100644 > --- a/scripts/qapi-visit.py > +++ b/scripts/qapi-visit.py > @@ -297,7 +297,9 @@ void visit_type_%(c_name)s(Visitor *v, %(c_name)s *= *obj, const char *name, Error > out_obj: > error_propagate(errp, err); > err =3D NULL; > - visit_end_union(v, !!(*obj)->u.data, &err); > + if (*obj) { > + visit_end_union(v, !!(*obj)->u.data, &err); > + } And of course, I managed to post a version that depends on patches not in the tree yet. v2 coming up. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --ow8XKpsfFnmqqPG3QAFD4piHPNUPpdrAL Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWHtcqAAoJEKeha0olJ0NqFz4H/iNOrA9r3jeNpZdsHmuweCjP 046+h6cPP3CQlKoOLieJATP7pATJdarCHcELDC9rBWaubFzB3wBZaO4rzDJXMhPN 9n4QLqyAHdS3/NZVNs2fmCZ/4QGMiFCKI/2kwcVkdlLJ05z2a8Lfh0Jjho9O8jXK BS73/F/jUj7MCFJzCmBP25zX169IU8z2FPe1s883typ1Qai0Z2vSCJ/HEWNSXbFk v/crQfFSXYM0KbXnIbZEJL7xJNh/jfRDJS1jweiBWtfWt5BDMzux2dt3mvchZZRk Qqv2WyCgABYzm3pa5ZNPI+Pexf4dDHJ/6bq+B2xqjwhq6EwWIv4QaakCAWIYf9U= =u0D/ -----END PGP SIGNATURE----- --ow8XKpsfFnmqqPG3QAFD4piHPNUPpdrAL--