From: Janosch Frank <frankja@linux.ibm.com>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, pbonzini@redhat.com, cohuck@redhat.com,
philmd@redhat.com, borntraeger@de.ibm.com
Subject: [PATCH v2] qobject: Fix maybe uninitialized in qdict_array_split
Date: Tue, 15 Jun 2021 13:09:21 +0000 [thread overview]
Message-ID: <20210615130921.55008-1-frankja@linux.ibm.com> (raw)
Lets make the compiler happy.
Found on gcc version 10.3.0 (Ubuntu 10.3.0-1ubuntu1)
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
qobject/block-qdict.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/qobject/block-qdict.c b/qobject/block-qdict.c
index 1487cc5dd8..8d0f00bc3c 100644
--- a/qobject/block-qdict.c
+++ b/qobject/block-qdict.c
@@ -224,7 +224,6 @@ void qdict_array_split(QDict *src, QList **dst)
for (i = 0; i < UINT_MAX; i++) {
QObject *subqobj;
bool is_subqdict;
- QDict *subqdict;
char indexstr[32], prefix[32];
size_t snprintf_ret;
@@ -249,14 +248,16 @@ void qdict_array_split(QDict *src, QList **dst)
}
if (is_subqdict) {
+ QDict *subqdict = NULL;
+
qdict_extract_subqdict(src, &subqdict, prefix);
assert(qdict_size(subqdict) > 0);
+ qlist_append_obj(*dst, QOBJECT(subqdict));
} else {
qobject_ref(subqobj);
qdict_del(src, indexstr);
+ qlist_append_obj(*dst, subqobj);
}
-
- qlist_append_obj(*dst, subqobj ?: QOBJECT(subqdict));
}
}
--
2.30.2
next reply other threads:[~2021-06-15 13:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-15 13:09 Janosch Frank [this message]
2021-09-16 10:25 ` [PATCH v2] qobject: Fix maybe uninitialized in qdict_array_split Laurent Vivier
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=20210615130921.55008-1-frankja@linux.ibm.com \
--to=frankja@linux.ibm.com \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/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).