diff options
author | nico <nico@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2011-11-03 08:12:17 +0000 |
---|---|---|
committer | nico <nico@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2011-11-03 08:12:17 +0000 |
commit | de6080b7c2e5f3d2a9ed9677e3df0667bfc31842 (patch) | |
tree | eb58ec73d536f522a7df85a6fe9c3bec7a97049c /package/dropbear/patches/160-segfault_fwd_localhost.patch | |
parent | 93005b12c529da797699c24c58243379ffed1efd (diff) |
package/dropbear: fix segfault with remote port forwarding (closes: #10339)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@28718 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/dropbear/patches/160-segfault_fwd_localhost.patch')
-rw-r--r-- | package/dropbear/patches/160-segfault_fwd_localhost.patch | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/package/dropbear/patches/160-segfault_fwd_localhost.patch b/package/dropbear/patches/160-segfault_fwd_localhost.patch new file mode 100644 index 000000000..05ae844c1 --- /dev/null +++ b/package/dropbear/patches/160-segfault_fwd_localhost.patch @@ -0,0 +1,40 @@ +http://wl500g.googlecode.com/svn/trunk/dropbear/011-fwd-all-segfault.patch +https://dev.openwrt.org/ticket/10339 + +--- a/svr-tcpfwd.c ++++ b/svr-tcpfwd.c +@@ -210,15 +210,13 @@ static int svr_remotetcpreq() { + tcpinfo->chantype = &svr_chan_tcpremote; + tcpinfo->tcp_type = forwarded; + +- if (!opts.listen_fwd_all +- || (strcmp(tcpinfo->listenaddr, "localhost") == 0) ) { +- // NULL means "localhost only" +- tcpinfo->listenaddr = NULL; +- } +- else +- { +- tcpinfo->listenaddr = bindaddr; +- } ++ if (!opts.listen_fwd_all || (strcmp(bindaddr, "localhost") == 0) ) { ++ // NULL means "localhost only" ++ tcpinfo->listenaddr = NULL; ++ } ++ else { ++ tcpinfo->listenaddr = bindaddr; ++ } + + ret = listen_tcpfwd(tcpinfo); + +--- a/tcp-accept.c ++++ b/tcp-accept.c +@@ -80,6 +80,9 @@ static void tcp_acceptor(struct Listener + addr = tcpinfo->listenaddr; + port = tcpinfo->listenport; + } ++ if (!addr) { ++ addr = "localhost"; ++ } + + buf_putstring(ses.writepayload, addr, strlen(addr)); + buf_putint(ses.writepayload, port); |