Message ID | 20210328160619.4015954-3-laurent@vivier.eu |
---|---|
State | New |
Headers | show |
Series | [PULL,1/2] linux-user/s390x: Use the guest pointer for the sigreturn stub | expand |
diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 1e508576c73e..294779c86f4d 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -3679,9 +3679,14 @@ static abi_long do_recvfrom(int fd, abi_ulong msg, size_t len, int flags, void *host_msg; abi_long ret; - host_msg = lock_user(VERIFY_WRITE, msg, len, 0); - if (!host_msg) - return -TARGET_EFAULT; + if (!msg) { + host_msg = NULL; + } else { + host_msg = lock_user(VERIFY_WRITE, msg, len, 0); + if (!host_msg) { + return -TARGET_EFAULT; + } + } if (target_addr) { if (get_user_u32(addrlen, target_addrlen)) { ret = -TARGET_EFAULT;