From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmdKN-000220-8W for qemu-devel@nongnu.org; Thu, 15 Oct 2015 03:51:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZmdKI-0002Pj-A0 for qemu-devel@nongnu.org; Thu, 15 Oct 2015 03:51:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43363) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmdKI-0002PL-4d for qemu-devel@nongnu.org; Thu, 15 Oct 2015 03:51:50 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 72129C0BB2A5 for ; Thu, 15 Oct 2015 07:51:49 +0000 (UTC) From: Markus Armbruster Date: Thu, 15 Oct 2015 09:51:34 +0200 Message-Id: <1444895505-16067-2-git-send-email-armbru@redhat.com> In-Reply-To: <1444895505-16067-1-git-send-email-armbru@redhat.com> References: <1444895505-16067-1-git-send-email-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 01/12] qapi: Fix regression with '-netdev help' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org From: Eric Blake Commit e36c714e causes 'qemu -netdev help' to dump core, because the call to visit_end_union() is no longer conditional on whether *obj was allocated. Reported by Marc-Andr=C3=A9 Lureau Signed-off-by: Eric Blake Message-Id: <1444861825-19256-1-git-send-email-eblake@redhat.com> [Commit message tweaked to say 'help' instead of '?'] Signed-off-by: Markus Armbruster --- scripts/qapi-visit.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py index 4f97781..d7f51ee 100644 --- a/scripts/qapi-visit.py +++ b/scripts/qapi-visit.py @@ -301,7 +301,9 @@ void visit_type_%(c_name)s(Visitor *v, %(c_name)s **o= bj, const char *name, Error out_obj: error_propagate(errp, err); err =3D NULL; - visit_end_union(v, !!(*obj)->data, &err); + if (*obj) { + visit_end_union(v, !!(*obj)->data, &err); + } error_propagate(errp, err); err =3D NULL; visit_end_struct(v, &err); --=20 2.4.3