[PATCH] glob: Avoid copying the d_name field of struct dirent [BZ #19779]

Florian Weimer fweimer@redhat.com
Wed May 4 10:10:00 GMT 2016


On 05/03/2016 11:46 PM, Roland McGrath wrote:
>>>> +      struct readdir_result result = {NULL};
>>>
>>> Put spaces around NULL, or just use {} (which has the same semantics).
>>
>> I have to use NULL because empty initializers are not part of C89.  So I
>> added the spaces.
>
> OK.  FWIW, I usually use a trailing comma i.e. "{ NULL, }" as implicit
> documentation that it's zero-initializing members I didn't list explicitly.

I pushed the patch with this change.  I added this NEWS entry:

* The glob function suffered from a stack-based buffer overflow when it was
   called with the GLOB_ALTDIRFUNC flag and encountered a long file name.
   Reported by Alexander Cherepanov.  (CVE-2016-1234)

Thanks for your patience.

Florian



More information about the Libc-alpha mailing list