mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-10-28 19:53:46 +00:00
Validate hostname in redir mode #1047
This commit is contained in:
+2
-1
@@ -435,7 +435,8 @@ remote_send_cb(EV_P_ ev_io *w, int revents)
|
||||
buffer_t *abuf = &ss_addr_to_send;
|
||||
balloc(abuf, BUF_SIZE);
|
||||
|
||||
if (server->hostname_len > 0) { // HTTP/SNI
|
||||
if (server->hostname_len > 0
|
||||
&& validate_hostname(server->hostname, server->hostname_len)) { // HTTP/SNI
|
||||
uint16_t port;
|
||||
if (AF_INET6 == server->destaddr.ss_family) { // IPv6
|
||||
port = (((struct sockaddr_in6 *)&(server->destaddr))->sin6_port);
|
||||
|
||||
Reference in New Issue
Block a user