From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCsmn-0007Ai-A3 for qemu-devel@nongnu.org; Mon, 10 Feb 2014 10:28:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WCsmi-0007rJ-EJ for qemu-devel@nongnu.org; Mon, 10 Feb 2014 10:28:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:6192) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCsmh-0007rB-Tj for qemu-devel@nongnu.org; Mon, 10 Feb 2014 10:28:36 -0500 Message-ID: <52F8F01D.5000707@redhat.com> Date: Mon, 10 Feb 2014 08:28:29 -0700 From: Eric Blake MIME-Version: 1.0 References: <1392042045-31525-1-git-send-email-armbru@redhat.com> <1392042045-31525-14-git-send-email-armbru@redhat.com> In-Reply-To: <1392042045-31525-14-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="PN01XofPrmQpApbHkdQfjwFHv8BkKV6FL" Subject: Re: [Qemu-devel] [PATCH 13/13] qapi: Add missing null check to opts_start_struct() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: kwolf@redhat.com, pbonzini@redhat.com, mdroth@linux.vnet.ibm.com, aliguori@amazon.com, peter.maydell@linaro.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --PN01XofPrmQpApbHkdQfjwFHv8BkKV6FL Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 02/10/2014 07:20 AM, Markus Armbruster wrote: > Argument is null when visiting an unboxed struct. I can't see such a > visit in the current code. Fix it anyway. Is this a sign of missing testsuite coverage? >=20 > Signed-off-by: Markus Armbruster > --- > qapi/opts-visitor.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) Reviewed-by: Eric Blake >=20 > diff --git a/qapi/opts-visitor.c b/qapi/opts-visitor.c > index 96ed858..5d830a2 100644 > --- a/qapi/opts-visitor.c > +++ b/qapi/opts-visitor.c > @@ -124,7 +124,9 @@ opts_start_struct(Visitor *v, void **obj, const cha= r *kind, > OptsVisitor *ov =3D DO_UPCAST(OptsVisitor, visitor, v); > const QemuOpt *opt; > =20 > - *obj =3D g_malloc0(size > 0 ? size : 1); > + if (obj) { > + *obj =3D g_malloc0(size > 0 ? size : 1); > + } > if (ov->depth++ > 0) { > return; > } >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --PN01XofPrmQpApbHkdQfjwFHv8BkKV6FL 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 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJS+PAdAAoJEKeha0olJ0NqWikH/3+nA+/KxYQPofO0/SNAKe8G AHOiAgBjWfSOfflQm5vu7Np577KcbI+tJwEt1v7ICQrS62g0+QXL1G5ErbXW9j9H UfQLp+CngppfEydoqONEwd1m6yjEIQfkBlLUQaOhNfOvl9yZYQkB5wHB689/jQsp RCfqxV7+yKjfURJNIMxaEKj5bv3tlxrettvnan8ctxU5QVKiRnGL8sCtcVNEnyjB 76qGc7ZroQLpVYnLIQIbcrJIhUHpsTLhyiRQtKKbWcgLGNZpyNZk0kjLk/5jKVZp 3t6iXl5qFPmyhRtULNITCmgDcMNNoX/O2uhyNnyDlNP5VPPzLHbNNBSAJl3gSKE= =QAWC -----END PGP SIGNATURE----- --PN01XofPrmQpApbHkdQfjwFHv8BkKV6FL--