]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
address use after free error
authorMark Andrews <marka@isc.org>
Sun, 16 Aug 2015 10:28:52 +0000 (20:28 +1000)
committerMark Andrews <marka@isc.org>
Sun, 16 Aug 2015 10:30:10 +0000 (20:30 +1000)
(cherry picked from commit 6458ad3ab288bb09e730fd7251083974a9b55af2)

bin/named/lwresd.c

index 7ee2196364e939d693170bbe1f94f468b1dda3a6..82b5ce9de2997eed402e60124a7da0437ebcdba1 100644 (file)
@@ -602,7 +602,7 @@ listener_copysock(ns_lwreslistener_t *oldlistener,
 
 static isc_result_t
 listener_startclients(ns_lwreslistener_t *listener) {
-       ns_lwdclientmgr_t *cm;
+       ns_lwdclientmgr_t *cm, *next;
        unsigned int i;
        isc_result_t result;
 
@@ -626,6 +626,7 @@ listener_startclients(ns_lwreslistener_t *listener) {
        LOCK(&listener->lock);
        cm = ISC_LIST_HEAD(listener->cmgrs);
        while (cm != NULL) {
+               next = ISC_LIST_NEXT(cm, link);
                result = ns_lwdclient_startrecv(cm);
                if (result != ISC_R_SUCCESS)
                        isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
@@ -633,7 +634,7 @@ listener_startclients(ns_lwreslistener_t *listener) {
                                      "could not start lwres "
                                      "client handler: %s",
                                      isc_result_totext(result));
-               cm = ISC_LIST_NEXT(cm, link);
+               cm = next;
        }
        UNLOCK(&listener->lock);