[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] migration: don't use uninitialized variables
From: |
Luiz Capitulino |
Subject: |
Re: [Qemu-devel] [PATCH] migration: don't use uninitialized variables |
Date: |
Mon, 29 Jul 2013 16:52:02 -0400 |
On Fri, 19 Jul 2013 11:36:41 +0900
Pawit Pornkitprasan <address@hidden> 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 <address@hidden>
> ---
> 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);