From: Stephan Bosch Date: Mon, 20 Nov 2017 00:26:21 +0000 (+0100) Subject: lib: llist: Fixed setting (after)->next->prev in DLLIST2_INSERT_AFTER_FULL. X-Git-Tag: 2.3.0.rc1~383 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ab7221dac60f0bda81925f5bfc694d5bb2e8bf2;p=thirdparty%2Fdovecot%2Fcore.git lib: llist: Fixed setting (after)->next->prev in DLLIST2_INSERT_AFTER_FULL. This function was not yet used, so the problem did not affect existing code. --- diff --git a/src/lib/llist.h b/src/lib/llist.h index 4517117eb1..8a52e87335 100644 --- a/src/lib/llist.h +++ b/src/lib/llist.h @@ -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); \