about summary refs log tree commit diff
path: root/src/liballoc/string.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-06-26 03:49:37 +0000
committerbors <bors@rust-lang.org>2018-06-26 03:49:37 +0000
commit7d2fa4a4d218b85c5af04981ea184cdb018cf215 (patch)
treef4098a7b553c0258356adf518eb6f19b1ec02529 /src/liballoc/string.rs
parentfdd9cdc8792d8fa4a64956c7d3263fa5ce18e335 (diff)
parentaf75314ecdbc5564f300467e732fdb5c923a873a (diff)
downloadrust-7d2fa4a4d218b85c5af04981ea184cdb018cf215.tar.gz
rust-7d2fa4a4d218b85c5af04981ea184cdb018cf215.zip
Auto merge of #50630 - sharkdp:fix-50619, r=sfackler
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