From: Luiz Capitulino <lcapitulino@redhat.com>
To: Peter Lieven <pl@kamp.de>
Cc: mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org,
armbru@redhat.com, qemu-stable@nongnu.org, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH] Revert "qapi: Clean up superfluous null check in qapi_dealloc_type_str()"
Date: Thu, 8 May 2014 14:21:13 -0400 [thread overview]
Message-ID: <20140508142113.7cd1cf15@redhat.com> (raw)
In-Reply-To: <1399564995-23956-1-git-send-email-pl@kamp.de>
On Thu, 8 May 2014 18:03:15 +0200
Peter Lieven <pl@kamp.de> wrote:
> This reverts commit 25a7017555f1b4aeb543b5d323ff4afb8f9c5437.
>
> Turns out the argument *can* be null: QEMU now segfaults if it
> receives an invalid parameter via a qmp command instead of throwing an
> error.
>
> For example:
> { "execute": "blockdev-add",
> "arguments": { "options" : { "driver": "invalid-driver" } } }
>
> CC: qemu-stable@nongnu.org
> Signed-off-by: Peter Lieven <pl@kamp.de>
> Reviewed-by: Eric Blake <eblake@redhat.com>
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
Applied to the qmp branch, thanks.
> ---
> qapi/qapi-dealloc-visitor.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/qapi/qapi-dealloc-visitor.c b/qapi/qapi-dealloc-visitor.c
> index d0ea118..dc53545 100644
> --- a/qapi/qapi-dealloc-visitor.c
> +++ b/qapi/qapi-dealloc-visitor.c
> @@ -131,7 +131,9 @@ static void qapi_dealloc_end_list(Visitor *v, Error **errp)
> static void qapi_dealloc_type_str(Visitor *v, char **obj, const char *name,
> Error **errp)
> {
> - g_free(*obj);
> + if (obj) {
> + g_free(*obj);
> + }
> }
>
> static void qapi_dealloc_type_int(Visitor *v, int64_t *obj, const char *name,
prev parent reply other threads:[~2014-05-08 18:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-08 16:03 [Qemu-devel] [PATCH] Revert "qapi: Clean up superfluous null check in qapi_dealloc_type_str()" Peter Lieven
2014-05-08 18:21 ` Luiz Capitulino [this message]
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=20140508142113.7cd1cf15@redhat.com \
--to=lcapitulino@redhat.com \
--cc=armbru@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=pbonzini@redhat.com \
--cc=pl@kamp.de \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.