Do not stop iovec conversion on iov_base == NULL if iov_len is 0

---
 linux-user/syscall.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index d099e97..5dc6594 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -1028,7 +1028,7 @@ static abi_long lock_iovec(int type, struct iovec *vec, 
abi_ulong target_addr,
         base = tswapl(target_vec[i].iov_base);
         vec[i].iov_len = tswapl(target_vec[i].iov_len);
         vec[i].iov_base = lock_user(type, base, vec[i].iov_len, copy);
-       if (!vec[i].iov_base) 
+       if (!vec[i].iov_base && vec[i].iov_len)
             goto fail;
     }
     unlock_user (target_vec, target_addr, 0);
-- 
Regards,  Kirill A. Shutemov
 + Belarus, Minsk
 + Velesys Ltd, http://www.velesys.com/
 + ALT Linux Team, http://www.altlinux.com/

Attachment: signature.asc
Description: Digital signature

Reply via email to