From: Blue Swirl <blauwirbel@gmail.com>
To: Luiz Capitulino <lcapitulino@redhat.com>
Cc: qemu-devel@nongnu.org, agl@us.ibm.com
Subject: Re: [Qemu-devel] [PATCH] Monitor: Fix command execution regression
Date: Thu, 28 Jan 2010 19:20:06 +0000 [thread overview]
Message-ID: <f43fc5581001281120v6561273dtb360b5c3118ebe72@mail.gmail.com> (raw)
In-Reply-To: <20100127180117.5cf438bf@doriath>
Thanks, applied.
On Wed, Jan 27, 2010 at 8:01 PM, Luiz Capitulino <lcapitulino@redhat.com> wrote:
>
> Function is_async_return() added by commit 940cc30d0d4 assumes
> that 'data', which is returned by handlers, is always a QDict.
>
> This is not true, as QLists can also be returned, in this case
> we'll get a segfault.
>
> Fix that by checking if 'data' is a QDict.
>
> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
> ---
> monitor.c | 6 +++++-
> 1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/monitor.c b/monitor.c
> index fbae5ce..fb7c572 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -3700,7 +3700,11 @@ static void monitor_print_error(Monitor *mon)
>
> static int is_async_return(const QObject *data)
> {
> - return data && qdict_haskey(qobject_to_qdict(data), "__mon_async");
> + if (data && qobject_type(data) == QTYPE_QDICT) {
> + return qdict_haskey(qobject_to_qdict(data), "__mon_async");
> + }
> +
> + return 0;
> }
>
> static void monitor_call_handler(Monitor *mon, const mon_cmd_t *cmd,
> --
> 1.6.6
>
>
>
>
prev parent reply other threads:[~2010-01-28 19:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-27 20:01 [Qemu-devel] [PATCH] Monitor: Fix command execution regression Luiz Capitulino
2010-01-28 19:20 ` Blue Swirl [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=f43fc5581001281120v6561273dtb360b5c3118ebe72@mail.gmail.com \
--to=blauwirbel@gmail.com \
--cc=agl@us.ibm.com \
--cc=lcapitulino@redhat.com \
--cc=qemu-devel@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).