Ross Lagerwall added the comment:

Hi,

There shouldn't be a problem with the existing implementation since, according 
to posix:
"""
The pointer returned by readdir() points to data which may be overwritten by 
another call to readdir() on the same directory stream. This data is not 
overwritten by another call to readdir() on a different directory stream.
"""

Since each call to listdir() opens a different directory stream, this shouldn't 
be a problem.

Also, when using readdir_r(), struct dirent should not be allocated on the 
stack since the last field may be an unspecified size.
See the following for further reading about this:
http://elliotth.blogspot.co.uk/2012/10/how-not-to-use-readdirr3.html
http://womble.decadent.org.uk/readdir_r-advisory.html

Regards

----------
nosy: +rosslagerwall

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17428>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to