mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-22 08:53:29 +00:00
Make the behavior of sys_execve be consistent with Linux
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
b1ea422efa
commit
9a299b68f0
@ -159,6 +159,10 @@ fn read_cstring_vec(
|
|||||||
max_string_len: usize,
|
max_string_len: usize,
|
||||||
) -> Result<Vec<CString>> {
|
) -> Result<Vec<CString>> {
|
||||||
let mut res = Vec::new();
|
let mut res = Vec::new();
|
||||||
|
// On Linux, argv pointer and envp pointer can be specified as NULL.
|
||||||
|
if array_ptr == 0 {
|
||||||
|
return Ok(res);
|
||||||
|
}
|
||||||
let mut read_addr = array_ptr;
|
let mut read_addr = array_ptr;
|
||||||
let mut find_null = false;
|
let mut find_null = false;
|
||||||
for _ in 0..max_string_number {
|
for _ in 0..max_string_number {
|
||||||
|
Reference in New Issue
Block a user