Received: from eggs.gnu.org ([2001:4830:134:3::10]:33153) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bi0SQ-0001rc-IP for qemu-devel@nongnu.org; Thu, 08 Sep 2016 10:37:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bi0SM-0005PH-7X for qemu-devel@nongnu.org; Thu, 08 Sep 2016 10:37:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37016) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bi0SL-0005PA-Vg for qemu-devel@nongnu.org; Thu, 08 Sep 2016 10:37:34 -0400 References: <1470393800-7882-1-git-send-email-peter.maydell@linaro.org> From: Eric Blake Message-ID: <11e90c6d-c0f6-44a6-eec9-6262dcc1d49b@redhat.com> Date: Thu, 8 Sep 2016 09:37:32 -0500 MIME-Version: 1.0 In-Reply-To: <1470393800-7882-1-git-send-email-peter.maydell@linaro.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="rdejvXnns4MIqu37O0Q2vMQDXvoVDo47V" Subject: Re: [Qemu-devel] [PATCH for-2.7] qtest.c: Allow zero size in memset qtest commands List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , qemu-devel@nongnu.org Cc: patches@linaro.org, John Snow , Markus Armbruster This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --rdejvXnns4MIqu37O0Q2vMQDXvoVDo47V From: Eric Blake To: Peter Maydell , qemu-devel@nongnu.org Cc: patches@linaro.org, John Snow , Markus Armbruster Message-ID: <11e90c6d-c0f6-44a6-eec9-6262dcc1d49b@redhat.com> Subject: Re: [PATCH for-2.7] qtest.c: Allow zero size in memset qtest commands References: <1470393800-7882-1-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1470393800-7882-1-git-send-email-peter.maydell@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 08/05/2016 05:43 AM, Peter Maydell wrote: > Some tests use the qtest protocol "memset" command with a zero > size, expecting it to do nothing. However in the current code this > will result in calling memset() with a NULL pointer, which is > undefined behaviour. Detect and specially handle zero sizes to > avoid this. >=20 > Signed-off-by: Peter Maydell > --- > Looking at the code for the other commands that take a size > ('read', 'write', 'b64read' and 'b64write' they all assume a > non-zero size. I've left those alone though, somebody else can > make them do nothing on zero size if they feel it's important.) I obviously missed reviewing this in time for 2.7, but looks reasonable to me. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --rdejvXnns4MIqu37O0Q2vMQDXvoVDo47V 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/ iQEcBAEBCAAGBQJX0XesAAoJEKeha0olJ0NqNhkH/id+CoHYjqFBGLMLPoHAnFAH AFPRJ+QfdJsfHcohBM7jAX2HQE3NfIjAtj2oVdf4DdOQkL8R0JbIJlykWQUf9QlN 2dOmVe/u9uM+/y9B/nc0Gufmgka3TZoKzikOoTh3QAvI5fBgdt+GKAaPF2UXg14Q GIKaf/KlKwGdnpTQpEFXONngpY3yadDs2W1ysWiKgHR5hXc3WLsj82bGHUR0jWH0 hvMKLlZKhyh5Sk2Y+kvSihTM3tKW/02eZ2pYmWoW3Kx2Lwe8sihMKbpqhkbP+kmf ojUtxL7VLxcByNa+btE4jd/k0C4kkr/hm+k/Q4SeM+xO3NQWTqGITmSh+KGOsPQ= =9I+Q -----END PGP SIGNATURE----- --rdejvXnns4MIqu37O0Q2vMQDXvoVDo47V--