On Qui, 2016-06-30 at 17:42 +0200, Florian Weimer wrote: > On 06/30/2016 05:38 PM, Zdenek Kabelac wrote: > > > > > Cut & paste example code solution from lvm2: > > > > #if !defined(__GLIBC__) || (__GLIBC__ < 2) || ((__GLIBC__ == 2) && > > (__GLIBC_MINOR__ < 23)) > > /* readdir_r is deprecated with newer GLIBC */ > > struct dirent entry, *iter = 0; > > while ( (errno = readdir_r( d.d, &entry, &iter )) == 0 && iter > > ) { > > std::string ename( entry.d_name ); > > #else > > struct dirent *entry; > > errno = 0; > > while ( (entry = readdir( d.d )) ) { > > std::string ename( entry->d_name ); > > #endif > Why not use readdir unconditionally? > > The point of the deprecation was that readdir is much more portable > than > readir_r. Stack allocation of struct dirent is not supported; the > above > has a buffer overflow in the d_name field on many systems. I agree readdir_r should be replace with readdir I made this patch : https://www.virtualbox.org/attachment/ticket/15205/ VirtualBox-5.0.16-glibc.patch can someone confirm that is correct ? > Florian > -- > devel mailing list > devel@xxxxxxxxxxxxxxxxxxxxxxx > https://lists.fedoraproject.org/admin/lists/devel@lists.fedoraproject > .org -- Sérgio M. B. -- devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxxx https://lists.fedoraproject.org/admin/lists/devel@xxxxxxxxxxxxxxxxxxxxxxx