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
This commit is contained in:
ths 2007-03-19 13:05:13 +00:00
parent 0fa1bcb790
commit 01c227fba4

View File

@ -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));