diff options
author | Scott Dial <scott@scottdial.com> | 2016-05-04 14:45:09 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-05-04 14:45:09 -0400 |
commit | 0ca3f495c6fad074606ab75942b64738ed61926a (patch) | |
tree | c8dde61af6517af6b46955954463cd63629d3f3f /src | |
parent | 34a51d162153f12d34f2445c6efa72dc4f6ddcd8 (diff) | |
download | tor-0ca3f495c6fad074606ab75942b64738ed61926a.tar.gz tor-0ca3f495c6fad074606ab75942b64738ed61926a.zip |
Fix dnsserv.c assertion when no supported questions are requested.
The problem is that "q" is always set on the first iteration even
if the question is not a supported question. This set of "q" is
not necessary, and will be handled after exiting the loop if there
if a supported q->type was found.
[Changes file by nickm]
lease enter the commit message for your changes. Lines starting
Diffstat (limited to 'src')
-rw-r--r-- | src/or/dnsserv.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/or/dnsserv.c b/src/or/dnsserv.c index ecd45be77c..9b0368dd09 100644 --- a/src/or/dnsserv.c +++ b/src/or/dnsserv.c @@ -87,8 +87,6 @@ evdns_server_callback(struct evdns_server_request *req, void *data_) for (i = 0; i < req->nquestions; ++i) { if (req->questions[i]->dns_question_class != EVDNS_CLASS_INET) continue; - if (! q) - q = req->questions[i]; switch (req->questions[i]->type) { case EVDNS_TYPE_A: case EVDNS_TYPE_AAAA: @@ -96,7 +94,7 @@ evdns_server_callback(struct evdns_server_request *req, void *data_) /* We always pick the first one of these questions, if there is one. */ if (! supported_q) - supported_q = q; + supported_q = req->questions[i]; break; default: break; |