[PATCH v2 2/7] malloc: Additional checks for unsorted bin integrity I.

Florian Weimer fweimer@redhat.com
Mon Aug 20 12:59:00 GMT 2018


On 08/17/2018 04:07 PM, Florian Weimer wrote:
> On 01/16/2018 02:54 PM, Istvan Kurucsai wrote:
>> +          if (__glibc_unlikely ((prev_size (next) & ~(SIZE_BITS)) != 
>> size))
>> +            malloc_printerr ("malloc(): mismatching next->prev_size 
>> (unsorted)");
> 
> Is the masking required?  I think prev_size is stored without the bits.
> 
>> +          if (__glibc_unlikely (bck->fd != victim)
>> +              || __glibc_unlikely (victim->fd != unsorted_chunks (av)))
>> +            malloc_printerr ("malloc(): unsorted double linked list 
>> corrupted");
>> +          if (__glibc_unlikely (prev_inuse(next)))
>> +            malloc_printerr ("malloc(): invalid next->prev_inuse 
>> (unsorted)");
> 
> Space missing after prev_inuse.
> 
> Otherwise, this looks okay.

I accidentally pushed this without a ChangeLog entry.  Fixed with the 
attached patch.  Sorry about that.

Florian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-malloc-Add-ChangeLog-for-accidentally-committed-chan.patch
Type: text/x-patch
Size: 1639 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20180820/2bb2be30/attachment.bin>


More information about the Libc-alpha mailing list