From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42366) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VemVF-0004bz-V9 for qemu-devel@nongnu.org; Fri, 08 Nov 2013 08:53:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VemVB-0004xg-2q for qemu-devel@nongnu.org; Fri, 08 Nov 2013 08:53:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:19000) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VemVA-0004xW-Q2 for qemu-devel@nongnu.org; Fri, 08 Nov 2013 08:53:33 -0500 Message-ID: <527CECD7.9020202@redhat.com> Date: Fri, 08 Nov 2013 06:53:27 -0700 From: Eric Blake MIME-Version: 1.0 References: <1383707361-19580-1-git-send-email-gesaint@linux.vnet.ibm.com> <1383707361-19580-2-git-send-email-gesaint@linux.vnet.ibm.com> <20131108101940.GB26775@T430s.nay.redhat.com> In-Reply-To: <20131108101940.GB26775@T430s.nay.redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jr8kDVoxt86vgfGAjAEuwjnnvaGXh3BLm" Subject: Re: [Qemu-devel] [PATCH V6 1/5] block/qemu-img: Refine and export infinite loop checking in collect_image_info_list() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: famz@redhat.com, Xu Wang Cc: kwolf@redhat.com, wdongxu@linux.vnet.ibm.com, stefanha@gmail.com, qemu-devel@nongnu.org, Xu Wang , xiawenc@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --jr8kDVoxt86vgfGAjAEuwjnnvaGXh3BLm Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 11/08/2013 03:19 AM, Fam Zheng wrote: >=20 >> + BlockDriverState *bs; >> + BlockDriver *drv; >> + char fbuf[1024]; >=20 > Could use PATH_MAX. PATH_MAX is undefined on some platforms, and could also be defined to something larger than a page which could lead to nastiness if you end up overflowing the stack. I personally prefer malloc'd buffers rather than attempting to guess at how large to size things, although the rest of the code base also has similar caps at 1024 so this isn't making it worse= =2E --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --jr8kDVoxt86vgfGAjAEuwjnnvaGXh3BLm 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.4.15 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJSfOzXAAoJEKeha0olJ0NqPRQH/1550I7OtGwejo/5y22gwwnK 5WwK2Xv01p6Hnz3cYaNBHuMLZ8s7T+JPTQf/IMGmWf6+VrmU61KKOU/HYEliCc8j 1OkwMcx61aPlQM2yxdBQXVIWA232AyySy0SxpWIJQODITjTlJQ86gBzgfVypuKKV RYp91u5+Ildc9Mp3P9guXige5YJ+FkbiK4btvjLrMO70NPkz0I+gIFNhnyhLZgmU c07C1twKU8uYEm4ZQFNRrb3LaZn5jorPTM2U69gV1SzfPtcU/zgweQYaRCRx/8OS DCH3SgK9h5qHV/+8it0DS/GDauFFhUy9VdO4lr9trursxaXjS9a3Llci+O37Uuw= =ZbCn -----END PGP SIGNATURE----- --jr8kDVoxt86vgfGAjAEuwjnnvaGXh3BLm--