From 8d0013bbe0387535e0bc1bd7e250eb353e0e2327 Mon Sep 17 00:00:00 2001 From: ValdikSS Date: Thu, 18 Mar 2021 16:16:17 +0300 Subject: 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. --- svr-tcpfwd.c | 4 ++-- 1 file 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; } -- cgit v1.2.3