From: Max Reitz <mreitz@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
Max Reitz <mreitz@redhat.com>
Subject: [Qemu-devel] [PATCH 1/3] qemu-config: Sections must consist of keys
Date: Fri, 21 Feb 2014 19:11:39 +0100 [thread overview]
Message-ID: <1393006301-22514-2-git-send-email-mreitz@redhat.com> (raw)
In-Reply-To: <1393006301-22514-1-git-send-email-mreitz@redhat.com>
In config_parse_qdict_section(), the QList returned by
qdict_array_split() is assumed to only contain QDicts. Currently, this
is true but it may (and will) change in the future. Therefore, check
whether the assumption actually holds.
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
util/qemu-config.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/util/qemu-config.c b/util/qemu-config.c
index 797df71..f610101 100644
--- a/util/qemu-config.c
+++ b/util/qemu-config.c
@@ -413,6 +413,12 @@ static void config_parse_qdict_section(QDict *options, QemuOptsList *opts,
QDict *section = qobject_to_qdict(qlist_entry_obj(list_entry));
char *opt_name;
+ if (!section) {
+ error_setg(errp, "[%s] section (index %u) does not consist of "
+ "keys", opts->name, i);
+ goto out;
+ }
+
opt_name = g_strdup_printf("%s.%u", opts->name, i++);
subopts = qemu_opts_create(opts, opt_name, 1, &local_err);
g_free(opt_name);
--
1.9.0
next prev parent reply other threads:[~2014-02-21 18:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-21 18:11 [Qemu-devel] [PATCH 0/3] Extract non-QDicts in qdict_array_split() Max Reitz
2014-02-21 18:11 ` Max Reitz [this message]
2014-02-21 18:22 ` [Qemu-devel] [PATCH 1/3] qemu-config: Sections must consist of keys Eric Blake
2014-02-21 18:11 ` [Qemu-devel] [PATCH 2/3] qdict: Extract non-QDicts in qdict_array_split() Max Reitz
2014-02-21 18:37 ` Eric Blake
2014-02-21 19:40 ` Max Reitz
2014-02-21 18:11 ` [Qemu-devel] [PATCH 3/3] check-qdict: Adjust test for qdict_array_split() Max Reitz
2014-02-21 18:39 ` Eric Blake
2014-02-21 19:41 ` Max Reitz
2014-02-21 21:17 ` [Qemu-devel] [PATCH 0/3] Extract non-QDicts in qdict_array_split() Kevin Wolf
2014-02-21 22:32 ` Eric Blake
2014-02-26 17:16 ` Max Reitz
2014-02-26 18:18 ` Eric Blake
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1393006301-22514-2-git-send-email-mreitz@redhat.com \
--to=mreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).