This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]