# HG changeset patch # User ValdikSS # Date 1616073377 -10800 # Node ID 5015c80808c51eab685d2231ea55ae5e22672281 # Parent 1b160ed9474916069549398c1d724d1905502226 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. diff -r 1b160ed94749 -r 5015c80808c5 svr-tcpfwd.c --- a/svr-tcpfwd.c Mon Mar 08 21:59:10 2021 +0800 +++ b/svr-tcpfwd.c Thu Mar 18 16:16:17 2021 +0300 @@ -146,7 +146,7 @@ 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 @@ 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; }