about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorsharkdp <davidpeter@web.de>2018-06-12 21:03:27 +0200
committersharkdp <davidpeter@web.de>2018-06-12 21:03:27 +0200
commitaf75314ecdbc5564f300467e732fdb5c923a873a (patch)
tree22e6a7cd9ead097b94b3e3ccebf5ea7f0c9d1ca9 /src/liballoc
parentef8cb40c9c03fe60aac47c8736045231633dbdac (diff)
downloadrust-af75314ecdbc5564f300467e732fdb5c923a873a.tar.gz
rust-af75314ecdbc5564f300467e732fdb5c923a873a.zip
Fix possibly endless loop in ReadDir iterator
Certain directories in `/proc` can cause the `ReadDir`
iterator to loop indefinitely. We get an error code (22) when
calling libc's `readdir_r` on these directories, but `entry_ptr`
is `NULL` at the same time, signalling the end of the directory
stream.

This change introduces an internal state to the iterator such
that the `Some(Err(..))` value will only be returned once when
calling `next`. Subsequent calls will return `None`.

fixes #50619
Diffstat (limited to 'src/liballoc')
0 files changed, 0 insertions, 0 deletions