Received: from eggs.gnu.org ([2001:4830:134:3::10]:52678) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjpOp-0007Ah-7w for qemu-devel@nongnu.org; Tue, 13 Sep 2016 11:13:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjpOj-00035o-6f for qemu-devel@nongnu.org; Tue, 13 Sep 2016 11:13:26 -0400 References: <1473758138-19260-1-git-send-email-stefanha@redhat.com> From: Eric Blake Message-ID: <51364bff-0282-bb4b-3482-4e8979939f98@redhat.com> Date: Tue, 13 Sep 2016 10:13:07 -0500 MIME-Version: 1.0 In-Reply-To: <1473758138-19260-1-git-send-email-stefanha@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="muX1S62scVioiBLk5lH0isiecJsALPpgL" Subject: Re: [Qemu-devel] [PATCH] qcow2: avoid memcpy(dst, NULL, len) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --muX1S62scVioiBLk5lH0isiecJsALPpgL From: Eric Blake To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org Message-ID: <51364bff-0282-bb4b-3482-4e8979939f98@redhat.com> Subject: Re: [Qemu-devel] [PATCH] qcow2: avoid memcpy(dst, NULL, len) References: <1473758138-19260-1-git-send-email-stefanha@redhat.com> In-Reply-To: <1473758138-19260-1-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/13/2016 04:15 AM, Stefan Hajnoczi wrote: > Section "7.1.4 Use of library functions" in the C99 standard says: >=20 > If an argument to a function has an invalid value (such as [...] > a null pointer [...]) [...] the behavior is undefined. >=20 > Additionally the "searching and sorting" functions are specified as > requiring valid pointer values as described in 7.1.4. >=20 > This patch fixes the following static analyzer errors: >=20 > block/qcow2.c:1807:41: runtime error: null pointer passed as argument= 2, which is declared to never be null > block/qcow2-cluster.c:86:26: runtime error: null pointer passed as ar= gument 2, which is declared to never be null >=20 > Reported-by: Peter Maydell > Signed-off-by: Stefan Hajnoczi > --- > block/qcow2-cluster.c | 4 +++- > block/qcow2.c | 5 ++++- > 2 files changed, 7 insertions(+), 2 deletions(-) Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --muX1S62scVioiBLk5lH0isiecJsALPpgL 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/ iQEcBAEBCAAGBQJX2BeDAAoJEKeha0olJ0Nq9WkH/AwCXrfpbeGLkakp3F2tY8H3 x9nJjMN2McPGKSLFJZknPch2kyXlYLpQDIr5a0VeDlklk7054jc6U1/6gITC8+o0 JI8T7tBUlGb/nDfnC9y+v0ZiE4wf/fBO4/petKnwYGp45NzQ5FFGhL9M8jqKRV5/ Q6s/Fa2nbMIozo6Fr+NFHSFKup6dBXL/UldsanipfkazTgD1XneoPBrTOYB1OCMD CHkJpHrLS7W4tOKu6WiL9u++E24M3NTe6YwcqkEiMCTOx5TvpIMKM6Dhi13l38FM 6zZOUAwXC5IMlDyZscsJsCBJfGQp04y++nccc4df5szWsYLS1ZOXWUdUkcf7b6w= =falq -----END PGP SIGNATURE----- --muX1S62scVioiBLk5lH0isiecJsALPpgL--