-
-
Notifications
You must be signed in to change notification settings - Fork 693
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 issue 24549 - std.process.environment.get(null) segfaults #9002
Conversation
Thanks for your pull request, @schveiguy! Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "stable + phobos#9002" |
Would it more correct to do something like |
Won't this lead to a different behavior between |
I think in this case, it doesn't matter -- I don't think an empty string is a valid environment variable name. |
Yes, but the distinction between empty string and |
There are many ways to solve this. I think if we are going to do a check for null anyway, we might as well circumvent the entire process. Why call an opaque C function when we know it's going to return "variable not found"? |
All green now. Would be nice to get this in the next release... |
The true fix I think would b to make it so tempCString never returns null (it doesn't make a lot of sense). But the code was clearly intended to work this way, and was set up because of a long ago regression.
Even if that problem is eventually fixed, this fix is not invalidated.