glob: port to clang's Undefined Sanitizer
commitf320c1ebec8a551bfd32d264371a1c4ab4c8f0d6
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 22 Aug 2017 17:13:50 +0000 (22 10:13 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 22 Aug 2017 17:26:40 +0000 (22 10:26 -0700)
tree3497ab4c61a980fe059d1bd75f683d1cf9deaeb9
parentb23000de1e47c7d580e0e220966dd1ee42a5e5bc
glob: port to clang's Undefined Sanitizer

Problem reported by Tim Rühsen in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-08/msg00144.html
* lib/glob.c (FLEXIBLE_ARRAY_MEMBER) [_LIBC]: Define to empty.
(glob_in_dir): Do not rely on undefined behavior in accessing
struct members beyond their bounds.  Use a flexible array member
instead.
ChangeLog
lib/glob.c