Просмотр исходного кода

linux-user: fixed recvfrom() addrlen

addrlen parameter of recvfrom() of type socklen_t* was read into
variable of type socklen_t, that caused zeroing out of upper 4 bytes
when running s390x on top of x86_64. This patch changes addrlen type
to abi_ulong.

Signed-off-by: Pavel Zbitskiy <pavel.zbitskiy@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Pavel Zbitskiy 11 лет назад
Родитель
Сommit
a39ca6a124
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      linux-user/syscall.c

+ 1 - 1
linux-user/syscall.c

@@ -2340,7 +2340,7 @@ static abi_long do_socketcall(int num, abi_ulong vptr)
             size_t len;
             size_t len;
             abi_ulong flags;
             abi_ulong flags;
             abi_ulong addr;
             abi_ulong addr;
-            socklen_t addrlen;
+            abi_ulong addrlen;
 
 
             if (get_user_ual(sockfd, vptr)
             if (get_user_ual(sockfd, vptr)
                 || get_user_ual(msg, vptr + n)
                 || get_user_ual(msg, vptr + n)