From 01c227fba4f1cefd47caa0aec8c5f503f0e29dc6 Mon Sep 17 00:00:00 2001 From: ths Date: Mon, 19 Mar 2007 13:05:13 +0000 Subject: [PATCH] Fix allocation sizes in getpeername/getsockname, spotted by Kirill A. Shutemov. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2499 c046a42c-6fe2-441c-8c8c-71466251a162 --- linux-user/syscall.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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));