We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a8ea671 commit 6f664cbCopy full SHA for 6f664cb
vm/src/stdlib/posix.rs
@@ -1338,7 +1338,7 @@ pub mod module {
1338
))]
1339
#[pyfunction]
1340
fn initgroups(user_name: PyStrRef, gid: Option<Gid>, vm: &VirtualMachine) -> PyResult<()> {
1341
- let user = CString::new(user_name.as_str()).unwrap();
+ let user = user_name.to_cstring(vm)?;
1342
let gid =
1343
gid.ok_or_else(|| vm.new_errno_error(1, "Operation not permitted".to_string()))?;
1344
unistd::initgroups(&user, gid).map_err(|err| err.into_pyexception(vm))
0 commit comments