All of lore.kernel.org
 help / color / mirror / Atom feed
From: Orit Wasserman <owasserm@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, 22 Jul 2013 10:32:30 +0300	[thread overview]
Message-ID: <51ECE00E.3050209@redhat.com> (raw)
In-Reply-To: <1374201401-11244-1-git-send-email-p.pawit@gmail.com>

On 07/19/2013 05:36 AM, Pawit Pornkitprasan 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;
>  
>      if (s->state == MIG_STATE_ACTIVE) {
>          error_set(errp, QERR_MIGRATION_ACTIVE);
> 

Reviewed-by: Orit Wasserman <owasserm@redhat.com>

  parent reply	other threads:[~2013-07-22  7:31 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 [this message]
2013-07-29 20:52 ` Luiz Capitulino
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=51ECE00E.3050209@redhat.com \
    --to=owasserm@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 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.