linux-user: fixed getsockopt() optlen
authorPavel Zbitskiy <pavel.zbitskiy@gmail.com>
Sat, 11 Jan 2014 09:34:10 +0000 (13:34 +0400)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 15 Jan 2014 19:36:03 +0000 (23:36 +0400)
optlen parameter of getsockopt() 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 optlen type
to abi_ulong.

Signed-off-by: Pavel Zbitskiy <pavel.zbitskiy@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
linux-user/syscall.c

index 0ac05b85f2d088153479efd42c18488f540ebead..a9ce6ba11c84b18aaac399c08969172263d2c3cb 100644 (file)
@@ -2406,7 +2406,7 @@ static abi_long do_socketcall(int num, abi_ulong vptr)
             abi_ulong level;
             abi_ulong optname;
             abi_ulong optval;
-            socklen_t optlen;
+            abi_ulong optlen;
 
             if (get_user_ual(sockfd, vptr)
                 || get_user_ual(level, vptr + n)