Skip to contentSkip to conversation

fix accept(2) with NULL peer

PATCH Applied Riku Voipio 2 participants 2 messages Jan 19, 2009 – Jan 30, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix accept(2) with NULL peer

Based on scratchbox2 patch by Mika Westerberg

---
 linux-user/syscall.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
linux-user/syscall.c +3 -0
index 53167e9..5e0b4ae 100644
@@ -1281,6 +1281,9 @@ static abi_long do_accept(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;
 
Signature · 5 lines
1.5.6.5


-- 
"rm -rf" only sounds scary if you don't have backups
#1 lore raw
Quoted 3 lines · Riku Voipio

Based on scratchbox2 patch by Mika Westerberg

Thanks, applied.

Quoted 27 lines
---
 linux-user/syscall.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
linux-user/syscall.c +3 -0
index 53167e9..5e0b4ae 100644
@@ -1281,6 +1281,9 @@ static abi_long do_accept(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;
 
Signature · 5 lines
1.5.6.5


-- 
"rm -rf" only sounds scary if you don't have backups
Signature · 2 lines
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net