summaryrefslogtreecommitdiffhomepage
path: root/tcp-accept.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2011-11-06 20:22:34 +0800
committerMatt Johnston <matt@ucc.asn.au>2011-11-06 20:22:34 +0800
commit59943acffe0b5bba9b440aeceafc018c90b8e7af (patch)
tree550bf96dc9264c94cdfb01902ac577dfc063d4cf /tcp-accept.c
parentd4e7654ed04785324fb80b15bb613957475e5b80 (diff)
Fix crash with -R forwarding
Diffstat (limited to 'tcp-accept.c')
-rw-r--r--tcp-accept.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tcp-accept.c b/tcp-accept.c
index 92d4afe..c133535 100644
--- a/tcp-accept.c
+++ b/tcp-accept.c
@@ -82,6 +82,9 @@ static void tcp_acceptor(struct Listener *listener, int sock) {
port = tcpinfo->listenport;
}
+ if (addr == NULL) {
+ addr = "localhost";
+ }
buf_putstring(ses.writepayload, addr, strlen(addr));
buf_putint(ses.writepayload, port);