mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-10 05:46: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;
|
let mut total_len = 0;
|
||||||
for i in 0..io_vec_count {
|
for i in 0..io_vec_count {
|
||||||
let io_vec = read_val_from_user::<IoVec>(io_vec_ptr + i * core::mem::size_of::<IoVec>())?;
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
let buffer = {
|
let buffer = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user