fix endian-specific read of SOCKS5 domain length

closes #624
This commit is contained in:
rofl0r
2026-10-06 07:14:46 +00:00
parent afc3612b41
commit aa87f65c4f

View File

@@ -402,11 +402,13 @@ static int tunnel_to(int sock, ip_type ip, unsigned short port, proxy_type pt, c
case 4:
len = 16;
break;
case 3:
len = 0;
if(1 != read_n_bytes(sock, (char *) &len, 1))
case 3: {
unsigned char blen;
if(1 != read_n_bytes(sock, (char *) &blen, 1))
goto err;
len = blen;
break;
}
default:
goto err;
}