]> granicus.if.org Git - strace/commitdiff
net: accept large option length for SO_LINGER
authorDmitry V. Levin <ldv@altlinux.org>
Sat, 8 Jul 2017 14:57:44 +0000 (14:57 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 8 Jul 2017 14:57:44 +0000 (14:57 +0000)
* net.c (print_linger): Allow len > sizeof(struct linger) to match
the kernel behaviour.

net.c

diff --git a/net.c b/net.c
index 273edda0599f3941ddb3baa3d5436e4c8a0dc554..5e20abc6ddf477d104d33337abf870d7ed864959 100644 (file)
--- a/net.c
+++ b/net.c
@@ -489,11 +489,12 @@ print_sockopt_fd_level_name(struct tcb *tcp, int fd, unsigned int level,
 }
 
 static void
-print_linger(struct tcb *const tcp, const kernel_ulong_t addr, const int len)
+print_linger(struct tcb *const tcp, const kernel_ulong_t addr,
+            const unsigned int len)
 {
        struct linger linger;
 
-       if (len != sizeof(linger) ||
+       if (len < sizeof(linger) ||
            umove(tcp, addr, &linger) < 0) {
                printaddr(addr);
                return;