qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] migration: don't use uninitialized variables
@ 2013-07-19  2:36 Pawit Pornkitprasan
  2013-07-19 10:57 ` Eric Blake
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Pawit Pornkitprasan @ 2013-07-19  2:36 UTC (permalink / raw)
  To: qemu-devel; +Cc: Pawit Pornkitprasan, Ryousei Takano, Juan Quintela

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);
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2013-07-30 15:22 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2013-07-29 23:29   ` Pawit Pornkitprasan

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).