From bd469af15ff04cf82d9badfc285e1c01a05b8164 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Mon, 26 Feb 2018 05:15:00 -0500 Subject: [PATCH] qapi: add assert about root value qiv->root should not be null, make that clearer with some assert. Backports commit 5d0cbbcfeb59e1e3f5ee7d26b8a215382f6d9abd from qemu --- qemu/qapi/qmp-input-visitor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qemu/qapi/qmp-input-visitor.c b/qemu/qapi/qmp-input-visitor.c index 744fb64f..e1b174f6 100644 --- a/qemu/qapi/qmp-input-visitor.c +++ b/qemu/qapi/qmp-input-visitor.c @@ -63,6 +63,7 @@ static QObject *qmp_input_get_object(QmpInputVisitor *qiv, if (QSLIST_EMPTY(&qiv->stack)) { /* Starting at root, name is ignored. */ + assert(qiv->root); return qiv->root; } @@ -398,6 +399,7 @@ Visitor *qmp_input_visitor_new(QObject *obj, bool strict) { QmpInputVisitor *v; + assert(obj); v = g_malloc0(sizeof(*v)); v->visitor.type = VISITOR_INPUT;