From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpmAR-00034S-Ak for qemu-devel@nongnu.org; Tue, 05 May 2015 19:22:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YpmAO-0001PY-49 for qemu-devel@nongnu.org; Tue, 05 May 2015 19:22:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39915) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpmAN-0001PT-TK for qemu-devel@nongnu.org; Tue, 05 May 2015 19:22:20 -0400 Message-ID: <554950A9.7050205@redhat.com> Date: Tue, 05 May 2015 17:22:17 -0600 From: Eric Blake MIME-Version: 1.0 References: <1430864578-22072-1-git-send-email-jsnow@redhat.com> <1430864578-22072-2-git-send-email-jsnow@redhat.com> In-Reply-To: <1430864578-22072-2-git-send-email-jsnow@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="WMP4mtjUNpgSvJkPkKxufFG87pGC0g760" Subject: Re: [Qemu-devel] [PATCH v3 1/5] qtest: allow arbitrarily long sends List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow , qemu-devel@nongnu.org Cc: pbonzini@redhat.com, afaerber@suse.de This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --WMP4mtjUNpgSvJkPkKxufFG87pGC0g760 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/05/2015 04:22 PM, John Snow wrote: > qtest currently has a static buffer of size 1024 that if we > overflow, ignores the additional data silently which leads > to hangs or stream failures. >=20 > Use glib's string facilities to allow arbitrarily long data, > but split this off into a new function, qtest_sendf. >=20 > Static data can still be sent using qtest_send, which avoids > the malloc/copy overflow. Did you mean 'overhead' instead of 'overflow'? >=20 > Signed-off-by: John Snow > --- > qtest.c | 46 ++++++++++++++++++++++++++++------------------ > 1 file changed, 28 insertions(+), 18 deletions(-) >=20 > qtest_send_prefix(chr); > - qtest_send(chr, "FAIL Unknown command `%s'\n", words[0]); > + qtest_sendf(chr, "FAIL Unknown command `%s'\n", words[0]); > } Unrelated - these days, I don't see `this' quoting much any more (except in m4); most people have moved to 'this' quoting. We could clean it while touching this line, but it really doesn't affect correctness either way. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --WMP4mtjUNpgSvJkPkKxufFG87pGC0g760 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVSVCpAAoJEKeha0olJ0NqslkIAJkd3QzB5WUrIQ5g0pLSKPY0 sfwR97A2hsbejeEVfeNn02HkjtIXoLSJqg+4TlS/691Te1S0cWNa0nTOyagXOPsd tfHEUOnVGANVF1H+CdiSBAFTc8KrQg95jIj2lBopKwBOHshnj1HaE/SsfrnOUf4r ZUsrhp5ZEZwq0+FFcPc1wxp2aICbLLqXFkipvYixkTVXmLvpFjAMBiiL/BWRljfr rhyt5xKtiqHz9nmXJbQjIdJEiQPNf2pp2pNPHLTy2jurmluWzQjlaOB6NzY7zIvr 2TgFL9k8vMmarlrglR601AJURiLmQ1QJ9xk6fAL5ZcW2YjZ/bcMdtfMvn5uvltc= =4sGi -----END PGP SIGNATURE----- --WMP4mtjUNpgSvJkPkKxufFG87pGC0g760--