diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 7e4b0594ed..85f275cb75 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -863,7 +863,7 @@ static long do_getpeername(int fd, target_ulong target_addr, target_ulong target_addrlen) { socklen_t addrlen = tget32(target_addrlen); - void *addr = alloca(target_addrlen); + void *addr = alloca(addrlen); long ret; ret = get_errno(getpeername(fd, addr, &addrlen)); @@ -878,7 +878,7 @@ static long do_getsockname(int fd, target_ulong target_addr, target_ulong target_addrlen) { socklen_t addrlen = tget32(target_addrlen); - void *addr = alloca(target_addrlen); + void *addr = alloca(addrlen); long ret; ret = get_errno(getsockname(fd, addr, &addrlen));