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 infinite recursion when empty path is provided to drush_mkdir #2862

Closed
wants to merge 1 commit into from
Closed

Fix infinite recursion when empty path is provided to drush_mkdir #2862

wants to merge 1 commit into from

Conversation

njbooher
Copy link

@njbooher njbooher commented Aug 2, 2017

Encountered this while trying debug an issue with site install.

@weitzman
Copy link
Member

weitzman commented Aug 2, 2017

Seems like we should fix the caller.

@njbooher
Copy link
Author

njbooher commented Aug 2, 2017

This causes segfaults depending on php settings and it took me a while to get here. I'll report the upstream error that leads to it when I find it.

Input validation is the responsibility of the function itself though. PHP's built in mkdir doesn't break like this.

@njbooher njbooher closed this Aug 3, 2017
@greg-1-anderson
Copy link
Member

+1 on merging this.

@weitzman
Copy link
Member

weitzman commented Aug 3, 2017

OK. The PR currently handles empty string. Should it handle NULL?

@greg-1-anderson
Copy link
Member

Yeah, empty($path) would be an improvement.

@njbooher
Copy link
Author

njbooher commented Aug 4, 2017

empty will return true for the string '0' which is a valid folder name. I added a type check for $path and made a new pull request #2864 since I can't seem to re-open this one or make changes to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants