mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-01 08:03:31 +01:00
Add missing check for hostname answer_len in dnsserv size
This is checked elsewhere too, but let's be RFC-conformant.
This commit is contained in:
parent
c2aa2db8b5
commit
31b562e10a
@ -271,6 +271,7 @@ dnsserv_resolved(edge_connection_t *conn,
|
|||||||
name,
|
name,
|
||||||
1, (char*)answer, ttl);
|
1, (char*)answer, ttl);
|
||||||
} else if (answer_type == RESOLVED_TYPE_HOSTNAME &&
|
} else if (answer_type == RESOLVED_TYPE_HOSTNAME &&
|
||||||
|
answer_len < 256 &&
|
||||||
conn->socks_request->command == SOCKS_COMMAND_RESOLVE_PTR) {
|
conn->socks_request->command == SOCKS_COMMAND_RESOLVE_PTR) {
|
||||||
char *ans = tor_strndup(answer, answer_len);
|
char *ans = tor_strndup(answer, answer_len);
|
||||||
evdns_server_request_add_ptr_reply(req, NULL,
|
evdns_server_request_add_ptr_reply(req, NULL,
|
||||||
|
Loading…
Reference in New Issue
Block a user