]> granicus.if.org Git - libevent/commitdiff
Checking request nameserver for NULL, before using it.
authorBelobrov Andrey <belobrovap@infotecs.ru>
Mon, 6 May 2013 14:15:03 +0000 (18:15 +0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 7 May 2013 14:01:36 +0000 (10:01 -0400)
evdns.c

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