mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-14 07:03:44 +01:00
Merge remote-tracking branch 'origin/maint-0.2.4'
This commit is contained in:
commit
221a0159b8
4
changes/bug9337
Normal file
4
changes/bug9337
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
o Major bugfixes (DNS):
|
||||||
|
- Avoid an assertion failure when processing DNS replies without the
|
||||||
|
answer types we expected. Fixes bug 9337; bugfix on 0.2.4.7-alpha.
|
||||||
|
|
@ -437,8 +437,8 @@ cached_resolve_add_answer(cached_resolve_t *resolve,
|
|||||||
if (resolve->res_status_ipv4 != RES_STATUS_INFLIGHT)
|
if (resolve->res_status_ipv4 != RES_STATUS_INFLIGHT)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (dns_result == DNS_ERR_NONE && answer_addr) {
|
if (dns_result == DNS_ERR_NONE && answer_addr &&
|
||||||
tor_assert(tor_addr_family(answer_addr) == AF_INET);
|
tor_addr_family(answer_addr) == AF_INET) {
|
||||||
resolve->result_ipv4.addr_ipv4 = tor_addr_to_ipv4h(answer_addr);
|
resolve->result_ipv4.addr_ipv4 = tor_addr_to_ipv4h(answer_addr);
|
||||||
resolve->res_status_ipv4 = RES_STATUS_DONE_OK;
|
resolve->res_status_ipv4 = RES_STATUS_DONE_OK;
|
||||||
} else {
|
} else {
|
||||||
@ -450,8 +450,8 @@ cached_resolve_add_answer(cached_resolve_t *resolve,
|
|||||||
if (resolve->res_status_ipv6 != RES_STATUS_INFLIGHT)
|
if (resolve->res_status_ipv6 != RES_STATUS_INFLIGHT)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (dns_result == DNS_ERR_NONE && answer_addr) {
|
if (dns_result == DNS_ERR_NONE && answer_addr &&
|
||||||
tor_assert(tor_addr_family(answer_addr) == AF_INET6);
|
tor_addr_family(answer_addr) == AF_INET6) {
|
||||||
memcpy(&resolve->result_ipv6.addr_ipv6,
|
memcpy(&resolve->result_ipv6.addr_ipv6,
|
||||||
tor_addr_to_in6(answer_addr),
|
tor_addr_to_in6(answer_addr),
|
||||||
sizeof(struct in6_addr));
|
sizeof(struct in6_addr));
|
||||||
|
Loading…
Reference in New Issue
Block a user