This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] time: Use struct alloc_buffer in __tzfile_read
* Paul Eggert:
> Florian Weimer wrote:
>> + if (alloc_buffer_alloc_array (&buf, __time64_t, num_transitions)
>> + != transitions)
>> + /* Either the start of the allocation moved unexpectedly
>> + (misaligned heap pointer, should not happen), or we had an
>> + overflow. */
>> + goto lose;
> Is this comparison needed? The overflow will be caught later anyway,
> and the != comparison cannot fail.
> Otherwise it looks good; thanks.
Okay, I will remove that. Even if the allocation moves the pointer
(after removal of the alignment code), we will not cause heap corruption
because the deallocation will use the original (non-moved) pointer.