[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH V6 1/5] block/qemu-img: Refine and export infini
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH V6 1/5] block/qemu-img: Refine and export infinite loop checking in collect_image_info_list() |
Date: |
Fri, 08 Nov 2013 06:53:27 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 |
On 11/08/2013 03:19 AM, Fam Zheng wrote:
>
>> + BlockDriverState *bs;
>> + BlockDriver *drv;
>> + char fbuf[1024];
>
> 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.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH V6 0/5] Refine and export backing file loop check, Xu Wang, 2013/11/05
- [Qemu-devel] [PATCH V6 2/5] qemu-img: Add infinite loop checking in bdrv_new_open(), Xu Wang, 2013/11/05
- [Qemu-devel] [PATCH V6 3/5] block: Add check infinite loop in bdrv_img_create(), Xu Wang, 2013/11/05
- [Qemu-devel] [PATCH V6 4/5] block: Add backing file loop check in change_backing_file(), Xu Wang, 2013/11/05
- [Qemu-devel] [PATCH V6 5/5] blockdev: Add infinite loop check in drive_init(), Xu Wang, 2013/11/05