qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qapi: Fix regression with '-netdev ?'
@ 2015-10-14 16:30 Eric Blake
  2015-10-14 22:28 ` Eric Blake
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Blake @ 2015-10-14 16:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, armbru, Michael Roth

Commit e36c714e causes 'qemu -netdev ?' to dump core, because the
call to visit_end_union() is no longer conditional on whether
*obj was allocated.

Reported by Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
---
 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 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 = NULL;
-    visit_end_union(v, !!(*obj)->u.data, &err);
+    if (*obj) {
+        visit_end_union(v, !!(*obj)->u.data, &err);
+    }
     error_propagate(errp, err);
     err = NULL;
     visit_end_struct(v, &err);
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-14 22:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-14 16:30 [Qemu-devel] [PATCH] qapi: Fix regression with '-netdev ?' Eric Blake
2015-10-14 22:28 ` Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).