diff options
| author | sharkdp <davidpeter@web.de> | 2018-06-12 21:03:27 +0200 |
|---|---|---|
| committer | sharkdp <davidpeter@web.de> | 2018-06-12 21:03:27 +0200 |
| commit | af75314ecdbc5564f300467e732fdb5c923a873a (patch) | |
| tree | 22e6a7cd9ead097b94b3e3ccebf5ea7f0c9d1ca9 /src/liballoc/string.rs | |
| parent | ef8cb40c9c03fe60aac47c8736045231633dbdac (diff) | |
| download | rust-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/string.rs')
0 files changed, 0 insertions, 0 deletions
