qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: Pawit Pornkitprasan <p.pawit@gmail.com>
Cc: Ryousei Takano <takano-ryousei@aist.go.jp>,
	qemu-devel@nongnu.org, Juan Quintela <quintela@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] migration: don't use uninitialized variables
Date: Mon, 29 Jul 2013 16:52:02 -0400	[thread overview]
Message-ID: <20130729165202.2f6d8b4b@redhat.com> (raw)
In-Reply-To: <1374201401-11244-1-git-send-email-p.pawit@gmail.com>

On Fri, 19 Jul 2013 11:36:41 +0900
Pawit Pornkitprasan <p.pawit@gmail.com> wrote:

> The qmp_migrate method uses the 'blk' and 'inc' parameter without
> checking if they're valid or not (they may be uninitialized if
> command is received via QMP)
> 
> Signed-off-by: Pawit Pornkitprasan <p.pawit@gmail.com>
> ---
>  migration.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/migration.c b/migration.c
> index 9f5a423..f3d1ff7 100644
> --- a/migration.c
> +++ b/migration.c
> @@ -385,8 +385,8 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
>      MigrationParams params;
>      const char *p;
>  
> -    params.blk = blk;
> -    params.shared = inc;
> +    params.blk = has_blk && blk;
> +    params.shared = has_inc && inc;

This doesn't apply anymore, can you rebase and resend?

By grepping around I can see that there are several instances of
this bug in other commands. I'm surprised we never got a single
bug report about this... Would you mind to fix all the instances?

>  
>      if (s->state == MIG_STATE_ACTIVE) {
>          error_set(errp, QERR_MIGRATION_ACTIVE);

  parent reply	other threads:[~2013-07-29 20:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-19  2:36 [Qemu-devel] [PATCH] migration: don't use uninitialized variables Pawit Pornkitprasan
2013-07-19 10:57 ` Eric Blake
2013-07-19 11:04   ` Pawit Pornkitprasan
2013-07-19 11:13     ` Eric Blake
2013-07-29 21:05   ` Luiz Capitulino
2013-07-30  0:15     ` Markus Armbruster
2013-07-30  1:29       ` Anthony Liguori
2013-07-30  6:39         ` Markus Armbruster
2013-07-30 13:26           ` Anthony Liguori
2013-07-30 15:22             ` Markus Armbruster
2013-07-22  7:32 ` Orit Wasserman
2013-07-29 20:52 ` Luiz Capitulino [this message]
2013-07-29 23:29   ` Pawit Pornkitprasan

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=20130729165202.2f6d8b4b@redhat.com \
    --to=lcapitulino@redhat.com \
    --cc=p.pawit@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=takano-ryousei@aist.go.jp \
    /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).