diff options
author | ValdikSS <iam@valdikss.org.ru> | 2021-03-18 16:16:17 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-18 21:16:17 +0800 |
commit | 8d0013bbe0387535e0bc1bd7e250eb353e0e2327 (patch) | |
tree | fee446c44842fa7525e2d106067aa6b59b51f25f | |
parent | 9262ffe8617bd8d631edf30772650ff4d5d156c6 (diff) |
Use MAX_HOST_LEN for TCP forwarding requests (#121)
tcpip-forward request can include hostname, which is later resolved by getaddrinfo() call.
Dropbear incorrectly assumes tcpip-forward includes only IP(v4) address. Fix this.
-rw-r--r-- | svr-tcpfwd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/svr-tcpfwd.c b/svr-tcpfwd.c index c3746bf..f3bab25 100644 --- a/svr-tcpfwd.c +++ b/svr-tcpfwd.c @@ -146,7 +146,7 @@ static int svr_cancelremotetcp() { TRACE(("enter cancelremotetcp")) bindaddr = buf_getstring(ses.payload, &addrlen); - if (addrlen > MAX_IP_LEN) { + if (addrlen > MAX_HOST_LEN) { TRACE(("addr len too long: %d", addrlen)) goto out; } @@ -181,7 +181,7 @@ static int svr_remotetcpreq(int *allocated_listen_port) { TRACE(("enter remotetcpreq")) request_addr = buf_getstring(ses.payload, &addrlen); - if (addrlen > MAX_IP_LEN) { + if (addrlen > MAX_HOST_LEN) { TRACE(("addr len too long: %d", addrlen)) goto out; } |