Skip to content

Always check variable type before using readdir to avoid surprises, fixes #4667 #4658 and #4613 - #4701

Merged
blizzz merged 3 commits into
stable5from
fix_4667
Sep 4, 2013
Merged

blizzz merged 3 commits into
stable5from
fix_4667

Conversation

@blizzz

@blizzz blizzz commented Sep 2, 2013

Copy link
Copy Markdown
Contributor

Readdir is said to return false if a folder could not be opened, but if the provided variable is not a proper parameter null is passed. Because since f42b69d we are (correctly!) strictly checking for a false, we can end up in an infinite loop that kills the web server, as reported in #4667 #4658 and #4613

please review @icewind1991 @karlitschek @schiesbn or others

P.S.: includes also fix a wrong var name.

@blizzz

blizzz commented Sep 2, 2013

Copy link
Copy Markdown
Contributor Author

If you want to read about the readdir behaviour see https://bugs.php.net/bug.php?id=52383

@ghost

ghost commented Sep 2, 2013

Copy link
Copy Markdown

@karlitschek

Copy link
Copy Markdown
Contributor

nice 👍

@karlitschek

Copy link
Copy Markdown
Contributor

Who can help to test this? @butonic @DeepDiver1975 @icewind1991 @bartv2

Comment thread lib/cache/file.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not really needed here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two are better than one ;) gonna fix it.

@bartv2

bartv2 commented Sep 3, 2013

Copy link
Copy Markdown
Contributor

looks good, didn't test

@blizzz

blizzz commented Sep 4, 2013

Copy link
Copy Markdown
Contributor Author

@ser72 tested it successfully in #4613 and #4667

@ghost

ghost commented Sep 4, 2013

Copy link
Copy Markdown

blizzz added a commit that referenced this pull request Sep 4, 2013
Always check variable type before using readdir to avoid surprises, fixes #4667 #4658 and #4613
@blizzz
blizzz merged commit 6cb839b into stable5 Sep 4, 2013
@blizzz
blizzz deleted the fix_4667 branch September 4, 2013 10:28
DeepDiver1975 added a commit that referenced this pull request Sep 13, 2013
some is_resource tests have been missing in #4701
@lock lock Bot locked as resolved and limited conversation to collaborators Aug 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants