From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V4989-0003vK-By for qemu-devel@nongnu.org; Tue, 30 Jul 2013 08:34:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V4984-0008AV-AA for qemu-devel@nongnu.org; Tue, 30 Jul 2013 08:34:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5881) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V4983-0008AK-Vk for qemu-devel@nongnu.org; Tue, 30 Jul 2013 08:34:16 -0400 Message-ID: <51F7B2C2.3090109@redhat.com> Date: Tue, 30 Jul 2013 06:34:10 -0600 From: Eric Blake MIME-Version: 1.0 References: <1375141192-1121-1-git-send-email-p.pawit@gmail.com> In-Reply-To: <1375141192-1121-1-git-send-email-p.pawit@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="cf5X2SNu6i0LGMtskGRI67fVRWDGgcaJn" Subject: Re: [Qemu-devel] [PATCH v2] migration: don't use uninitialized variables List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pawit Pornkitprasan Cc: Juan Quintela , Ryousei Takano , qemu-devel@nongnu.org, Luiz Capitulino This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --cf5X2SNu6i0LGMtskGRI67fVRWDGgcaJn Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/29/2013 05:39 PM, 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) >=20 > Signed-off-by: Pawit Pornkitprasan > --- > migration.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Eric Blake >=20 > diff --git a/migration.c b/migration.c > index 9fc7294..57a7998 100644 > --- a/migration.c > +++ b/migration.c > @@ -399,8 +399,8 @@ void qmp_migrate(const char *uri, bool has_blk, boo= l blk, > MigrationParams params; > const char *p; > =20 > - params.blk =3D blk; > - params.shared =3D inc; > + params.blk =3D has_blk && blk; > + params.shared =3D has_inc && inc; > =20 > if (s->state =3D=3D MIG_STATE_ACTIVE || s->state =3D=3D MIG_STATE_= SETUP) { > error_set(errp, QERR_MIGRATION_ACTIVE); >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --cf5X2SNu6i0LGMtskGRI67fVRWDGgcaJn Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJR97LCAAoJEKeha0olJ0Nqf6kH/3PyKl/yQYby97tIYEzFud0B XuvFNb3skWXpKyb3ygrIXP3vVDAmxqi8Jo/OOX+wyR3CqFVqPjHIyOLd5P8Nb8l7 hrbiVhfbDCVV4FfBeRX28oLKRJPqY6eqmV6l5zi+eA/u1lkwZNGe0P4e2hNpBxWc eN7yxlY3iiCKUQRQOiBFIuJ/tM6UyIJJG9uY8Ok+yRcqzHX/vF1tksdEgDOquQe2 +a7cOALluWpdGqH9PNOoFY8clKiK0KtjH8WZu5qTUBDPR69Z5tsfhJaX9d0K5H9v UM38TALHd3j1xOQ5AFjvCuUu+ICm8Pv5/m5YIMCkDHvJ7hU3th134RaDOqI2MqY= =hOjM -----END PGP SIGNATURE----- --cf5X2SNu6i0LGMtskGRI67fVRWDGgcaJn--