diff options
author | rl1987 <rl1987@sdf.lonestar.org> | 2018-10-26 10:26:47 +0300 |
---|---|---|
committer | rl1987 <rl1987@sdf.lonestar.org> | 2018-10-26 10:26:47 +0300 |
commit | b7edfcbf6bb3a27d914ad883ae75413a4d25739a (patch) | |
tree | 769710abc52238fa907177e2c771d3edc5b6cfeb /src/feature/relay/dns.c | |
parent | 98cef6807eb70e7c459f6f80a06f894fac63100a (diff) | |
download | tor-b7edfcbf6bb3a27d914ad883ae75413a4d25739a.tar.gz tor-b7edfcbf6bb3a27d914ad883ae75413a4d25739a.zip |
In configured_nameserver_address, check if tor_addr_from_sockaddr succeeded
Diffstat (limited to 'src/feature/relay/dns.c')
-rw-r--r-- | src/feature/relay/dns.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/feature/relay/dns.c b/src/feature/relay/dns.c index dfd84652ad..371c2f5069 100644 --- a/src/feature/relay/dns.c +++ b/src/feature/relay/dns.c @@ -1381,8 +1381,11 @@ configured_nameserver_address(const size_t idx) (struct sockaddr *)&sa, sa_len) > 0) { tor_addr_t *tor_addr = tor_malloc(sizeof(tor_addr_t)); - tor_addr_from_sockaddr(tor_addr, (const struct sockaddr *)&sa, NULL); - return tor_addr; + if (tor_addr_from_sockaddr(tor_addr, + (const struct sockaddr *)&sa, + NULL) == 0) { + return tor_addr; + } } return NULL; |