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

Florian Weimer fweimer@redhat.com
Fri Mar 11 21:33:00 GMT 2016


Introducing a new struct makes it unnecessary to copy the name out of
the dirent structure.   The name is subsequently allocated on the heap
anyway.

I extended the existing test with a long name.  The test now crashes
before the fix.

We should split sysdeps/unix/sysv/linux/i386/glob64.c into multiple
files, rather than including posix/glob.c multiple times.

DIRENT_MUST_BE can be removed, but that's an unrelated cleanup (it was
dead before).

Florian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-glob-Avoid-copying-the-d_name-field-of-struct-dirent.patch
Type: text/x-patch
Size: 10820 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20160311/07d75684/attachment.bin>


More information about the Libc-alpha mailing list