package/dropbear: fix segfault with remote port forwarding (closes: #10339)

SVN-Revision: 28718
This commit is contained in:
Nicolas Thill 2011-11-03 08:12:17 +00:00
parent c4e9e4d27e
commit d8722fac70
2 changed files with 41 additions and 1 deletions

View file

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=dropbear
PKG_VERSION:=0.53.1
PKG_RELEASE:=4
PKG_RELEASE:=5
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:= \

View file

@ -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);