For simplicity, here's the patch that fixes this bug (and is included in
openssh 7.8):

diff --git a/openbsd-compat/port-net.c b/openbsd-compat/port-net.c
index 7050629c..bb535626 100644
--- a/openbsd-compat/port-net.c
+++ b/openbsd-compat/port-net.c
@@ -185,7 +185,7 @@ sys_tun_open(int tun, int mode, char **ifname)
        else
                debug("%s: %s mode %d fd %d", __func__, ifr.ifr_name, mode, fd);
 
-       if (ifname != NULL && (*ifname = strdup(ifr.ifr_name)))
+       if (ifname != NULL && (*ifname = strdup(ifr.ifr_name)) == NULL)
                goto failed;
 
        return (fd);
@@ -272,7 +272,7 @@ sys_tun_open(int tun, int mode, char **ifname)
                        goto failed;
        }
 
-       if (ifname != NULL && (*ifname = strdup(ifr.ifr_name)))
+       if (ifname != NULL && (*ifname = strdup(ifr.ifr_name)) == NULL)
                goto failed;
 
        close(sock);

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1801128

Title:
  OpenSSH 7.7 -w tunnel bug

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/1801128/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to