On 04/27/2011 12:24 AM, Jim Meyering wrote:
>> fdutimensat-tests still pulls in xalloc, via utimecmp (which
>> calls xalloc_die if it can't manage a hash table).  So this
>> patch isn't quite perfect yet, but getting closer.  Any ideas
>> on whether it would be possible to make utimecmp work without
>> xalloc?
> 
> Looks feasible.
> The hash table is solely to avoid incurring the cost of calculating
> the time stamp resolution for every call.  The alternative is simply
> to incur the cost when hash table initialization or insertion fails.

Even worse, I just noticed that there is a NULL dereference on low
memory conditions in utimecmp.  The code tries to allocate ht, but then
blindly uses ht even if allocation failed.

I definitely agree that utimecmp's use of a hash-table is merely a
caching optimization, and therefore memory failure should not be fatal.
 I'll have a patch shortly...

-- 
Eric Blake   ebl...@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to