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.
This commit is contained in:
ValdikSS 2021-03-18 16:16:17 +03:00 committed by GitHub
parent 9262ffe861
commit 8d0013bbe0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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