Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix possibly endless loop in ReadDir iterator #50630

Merged
merged 1 commit into from
Jun 26, 2018
Merged

Fix possibly endless loop in ReadDir iterator #50630

merged 1 commit into from
Jun 26, 2018

Commits on Jun 12, 2018

  1. 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
    sharkdp committed Jun 12, 2018
    Configuration menu
    Copy the full SHA
    af75314 View commit details
    Browse the repository at this point in the history