mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 03:04:38 +08:00
check for '=' in environment variable name in os.execve
This commit is contained in:
1 parent
a35408a058
commit
d992eec95a
1 file changed
+5
@@ -1575,6 +1575,11 @@ mod posix {
|
||||
PyPathLike::try_from_object(&vm, k)?,
|
||||
PyPathLike::try_from_object(&vm, v)?,
|
||||
);
|
||||
|
||||
if key.path.display().to_string().contains('=') {
|
||||
return Err(vm.new_value_error("illegal environment variable name".to_owned()));
|
||||
}
|
||||
|
||||
ffi::CString::new(format!("{}={}", key.path.display(), value.path.display()))
|
||||
.map_err(|_| vm.new_value_error("embedded null character".to_owned()))
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user