Commit 01c227fba4f1cefd47caa0aec8c5f503f0e29dc6
1 parent
0fa1bcb7
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
Showing
1 changed file
with
2 additions
and
2 deletions
linux-user/syscall.c
@@ -863,7 +863,7 @@ static long do_getpeername(int fd, target_ulong target_addr, | @@ -863,7 +863,7 @@ static long do_getpeername(int fd, target_ulong target_addr, | ||
863 | target_ulong target_addrlen) | 863 | target_ulong target_addrlen) |
864 | { | 864 | { |
865 | socklen_t addrlen = tget32(target_addrlen); | 865 | socklen_t addrlen = tget32(target_addrlen); |
866 | - void *addr = alloca(target_addrlen); | 866 | + void *addr = alloca(addrlen); |
867 | long ret; | 867 | long ret; |
868 | 868 | ||
869 | ret = get_errno(getpeername(fd, addr, &addrlen)); | 869 | ret = get_errno(getpeername(fd, addr, &addrlen)); |
@@ -878,7 +878,7 @@ static long do_getsockname(int fd, target_ulong target_addr, | @@ -878,7 +878,7 @@ static long do_getsockname(int fd, target_ulong target_addr, | ||
878 | target_ulong target_addrlen) | 878 | target_ulong target_addrlen) |
879 | { | 879 | { |
880 | socklen_t addrlen = tget32(target_addrlen); | 880 | socklen_t addrlen = tget32(target_addrlen); |
881 | - void *addr = alloca(target_addrlen); | 881 | + void *addr = alloca(addrlen); |
882 | long ret; | 882 | long ret; |
883 | 883 | ||
884 | ret = get_errno(getsockname(fd, addr, &addrlen)); | 884 | ret = get_errno(getsockname(fd, addr, &addrlen)); |