Checking request nameserver for NULL, before using it.

This commit is contained in:
Belobrov Andrey 2013-05-06 18:15:03 +04:00 committed by Nick Mathewson
parent 959c1428cc
commit 5c710c0362

View File

@ -2215,6 +2215,12 @@ evdns_request_transmit(struct request *req) {
req->transmit_me = 1; req->transmit_me = 1;
EVUTIL_ASSERT(req->trans_id != 0xffff); EVUTIL_ASSERT(req->trans_id != 0xffff);
if (!req->ns)
{
/* unable to transmit request if no nameservers */
return 1;
}
if (req->ns->choked) { if (req->ns->choked) {
/* don't bother trying to write to a socket */ /* don't bother trying to write to a socket */
/* which we have had EAGAIN from */ /* which we have had EAGAIN from */