-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Setting process env vars with interior nuls leads to unexpected env for child #30862
Comments
As with #30858, it's probably best to validate when spawning the child, so that the error can be returned in a |
The underlying issue in both cases is that EDIT: apparently that’s intended, so we’re just skimping on conversion to CString in some places. |
Yeah, conversion to |
I have a patch in the works for this. |
This reports an error at the point of calling `Command::spawn()` or one of its equivalents. Fixes rust-lang#30858 Fixes rust-lang#30862
Noticed by @talchas when discussing #30858.
The environment variables are never checked for interior nuls. This leads to very unexpected results in the child's env. Keys with interior nuls are truncated and have no values, and values are truncated at the nul:
(playground)
Output:
The text was updated successfully, but these errors were encountered: