]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: llist: Fixed setting (after)->next->prev in DLLIST2_INSERT_AFTER_FULL.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Mon, 20 Nov 2017 00:26:21 +0000 (01:26 +0100)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Sun, 26 Nov 2017 20:30:01 +0000 (22:30 +0200)
This function was not yet used, so the problem did not affect existing code.

src/lib/llist.h

index 4517117eb154c97bd2c9aee55be128d374bbb51a..8a52e873352030befc35df2efb44684549d1fda7 100644 (file)
@@ -52,6 +52,8 @@
        STMT_START { \
        (item)->prev = (after); \
        (item)->next = (after)->next; \
+       if ((after)->next != NULL) \
+               (after)->next->prev = (item); \
        (after)->next = (item); \
        if (*(tail) == (after)) \
                *(tail) = (item); \