mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-08 21:06:48 +00:00
Fix writev
fault when io_vec.len
is 0
This commit is contained in:
parent
c778e0c07c
commit
4f575e2028
@ -41,7 +41,7 @@ fn do_sys_writev(fd: FileDescripter, io_vec_ptr: Vaddr, io_vec_count: usize) ->
|
||||
let mut total_len = 0;
|
||||
for i in 0..io_vec_count {
|
||||
let io_vec = read_val_from_user::<IoVec>(io_vec_ptr + i * core::mem::size_of::<IoVec>())?;
|
||||
if io_vec.base == 0 {
|
||||
if io_vec.base == 0 || io_vec.len == 0 {
|
||||
continue;
|
||||
}
|
||||
let buffer = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user