diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-01-15 13:09:12 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-01-15 13:09:12 -0500 |
commit | 31b562e10abe51cf9d520e0a3ad2ffc3277d52a4 (patch) | |
tree | a91c7c3a5f29dded3c75a90d73b20c589f039a5c | |
parent | c2aa2db8b5f523c62712d3c4944b1a4c4c514b1c (diff) | |
download | tor-31b562e10abe51cf9d520e0a3ad2ffc3277d52a4.tar.gz tor-31b562e10abe51cf9d520e0a3ad2ffc3277d52a4.zip |
Add missing check for hostname answer_len in dnsserv size
This is checked elsewhere too, but let's be RFC-conformant.
-rw-r--r-- | src/or/dnsserv.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/or/dnsserv.c b/src/or/dnsserv.c index 57c449311f..f8b5c3cdd2 100644 --- a/src/or/dnsserv.c +++ b/src/or/dnsserv.c @@ -271,6 +271,7 @@ dnsserv_resolved(edge_connection_t *conn, name, 1, (char*)answer, ttl); } else if (answer_type == RESOLVED_TYPE_HOSTNAME && + answer_len < 256 && conn->socks_request->command == SOCKS_COMMAND_RESOLVE_PTR) { char *ans = tor_strndup(answer, answer_len); evdns_server_request_add_ptr_reply(req, NULL, |