]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2037. [func] When unlinking the first or last element in a list
authorMark Andrews <marka@isc.org>
Mon, 5 Jun 2006 00:38:56 +0000 (00:38 +0000)
committerMark Andrews <marka@isc.org>
Mon, 5 Jun 2006 00:38:56 +0000 (00:38 +0000)
                        check that the list head points to the element to
                        be unlinked. [RT #15959]

CHANGES
lib/bind/include/isc/list.h

diff --git a/CHANGES b/CHANGES
index 0046e4e564c9a6efbac1ece2acc028e35e9017d1..599f9cef2d608c7dadbad15beb8a832949625128 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+2037.  [func]          When unlinking the first or last element in a list
+                       check that the list head points to the element to
+                       be unlinked. [RT #15959]
+
 2036.  [bug]           'rndc recursing' could cause trigger a REQUIRE.
                        [RT #16075]
 
index 816709b72394ff40373b80f6a1387ee04108c3b0..c85c6676b51c572e7694a49fa07c1832b59ccc46 100644 (file)
                INSIST(LINKED(elt, link));\
                if ((elt)->link.next != NULL) \
                        (elt)->link.next->link.prev = (elt)->link.prev; \
-               else \
+               else { \
+                       INSIST((list).tail == (elt)); \
                        (list).tail = (elt)->link.prev; \
+               } \
                if ((elt)->link.prev != NULL) \
                        (elt)->link.prev->link.next = (elt)->link.next; \
-               else \
+               else { \
+                       INSIST((list).head == (elt)); \
                        (list).head = (elt)->link.next; \
+               } \
                INIT_LINK_TYPE(elt, link, type); \
        } while (0)
 #define UNLINK(list, elt, link) \