From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40466) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wyi8V-0004fd-82 for qemu-devel@nongnu.org; Sun, 22 Jun 2014 09:48:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wyi8O-0008Kr-UO for qemu-devel@nongnu.org; Sun, 22 Jun 2014 09:48:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16665) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wyi8O-0008Kj-L7 for qemu-devel@nongnu.org; Sun, 22 Jun 2014 09:48:40 -0400 Date: Wed, 18 Jun 2014 12:06:53 +0800 From: Stefan Hajnoczi Message-ID: <20140618040653.GC14030@stefanha-thinkpad.redhat.com> References: <1402647300-27861-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3siQDZowHQqNOShm" Content-Disposition: inline In-Reply-To: <1402647300-27861-1-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH] libqtest: escape strings in QMP commands, fix leak List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, afaerber@suse.de --3siQDZowHQqNOShm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 13, 2014 at 10:15:00AM +0200, Paolo Bonzini wrote: > libqtest is using g_strdup_printf to format QMP commands, but > this does not work if the argument strings need to be escaped. > Instead, use the fancy %-formatting functionality of QObject. > The only change required in tests is that strings have to be > formatted as %s, not '%s' or \"%s\". Luckily this usage of > parameterized QMP commands is not that frequent. >=20 > The leak is in socket_sendf. Since we are extracting the send > loop to a new function, fix it now. >=20 > Signed-off-by: Paolo Bonzini > --- > tests/fdc-test.c | 2 +- > tests/libqtest.c | 47 +++++++++++++++++++++++++++++++++++++---------- > tests/qom-test.c | 6 +++--- > tests/tmp105-test.c | 4 ++-- > 4 files changed, 43 insertions(+), 16 deletions(-) Reviewed-by: Stefan Hajnoczi --3siQDZowHQqNOShm Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJToRBdAAoJEJykq7OBq3PIdT8IAJYwep+8vbjhsaOpQ0lqn6N7 IWvrXgZmw2jMVmwsf6qSIUjItS9vzwXjTvL3ydRfkLbI41XjvsTeXq723AIBhojZ sOsqkaFpzGAYgRNv6/sl3ITONXSMTEGAaGVFALQcXvS7QBRZcaRqvem4JgZYsKPD Ur6UGAAfeUby7aHGhs/YYRDFDdUGsI8m8JXi4ZtGglUPYjBnKYhZL8rzhSnxcMam 36EmcRj94+FD1bFs+E0ay45twVLuuiKmJpgHhLMZDeVMOHv9i8HBQBek+CmB6zQ8 yyzxoCTfzXb4cXBFI/0RGmsxChjrmp9wUd09C5iFkl26fMKMQzyCB8ynrjmL2T0= =6v4s -----END PGP SIGNATURE----- --3siQDZowHQqNOShm--