diff options
author | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-30 19:47:47 +0000 |
---|---|---|
committer | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-30 19:47:47 +0000 |
commit | 8fea36025b9d6d360ff3b78f88a84ccf221807e8 (patch) | |
tree | 520cfb119545737967c54f2fb1bb432cb8f6d966 /linux-user | |
parent | 08a2d4c4ffde60e48819449f461274c43ad6e2d3 (diff) | |
download | qemu-8fea36025b9d6d360ff3b78f88a84ccf221807e8.zip |
linux-user: fix accept(2) with NULL peer
Based on scratchbox2 patch by Mika Westerberg
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6478 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user')
-rw-r--r-- | linux-user/syscall.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 5d787bb753..dce5cad594 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -1267,6 +1267,9 @@ static abi_long do_getsockname(int fd, abi_ulong target_addr, void *addr; abi_long ret; + if (target_addr == 0) + return get_errno(accept(fd, NULL, NULL)); + if (get_user_u32(addrlen, target_addrlen_addr)) return -TARGET_EFAULT; |