]> granicus.if.org Git - libevent/commitdiff
Fix a crash bug in evdns server circular list code
authorNick Mathewson <nickm@torproject.org>
Wed, 20 Apr 2011 17:27:31 +0000 (13:27 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 20 Apr 2011 17:27:31 +0000 (13:27 -0400)
Really, this should use a circleq.  That's a change for 2.1, though.

evdns.c

diff --git a/evdns.c b/evdns.c
index 583c253aa4a39a7dd75f7e3a1572f1443e2a3254..ae39d17e1fa1ded7e2e97cc3e4556a3e5e632920 100644 (file)
--- a/evdns.c
+++ b/evdns.c
@@ -1993,7 +1993,7 @@ server_request_free(struct server_request *req)
                EVDNS_LOCK(req->port);
                lock=1;
                if (req->port->pending_replies == req) {
-                       if (req->next_pending)
+                       if (req->next_pending && req->next_pending != req)
                                req->port->pending_replies = req->next_pending;
                        else
                                req->port->pending_replies = NULL;