qemu-devel
[Top][All Lists]
Advanced

[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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]