pike: safety check for ll variable
authorDaniel-Constantin Mierla <miconda@gmail.com>
Tue, 13 Apr 2021 07:50:07 +0000 (09:50 +0200)
committerDaniel-Constantin Mierla <miconda@gmail.com>
Thu, 15 Apr 2021 06:34:37 +0000 (08:34 +0200)
(cherry picked from commit b123dec934769522407dad619bbb6c2074719884)

src/modules/pike/pike_funcs.c

index 804ebb6..7a01739 100644 (file)
@@ -211,8 +211,10 @@ void clean_routine(unsigned int ticks , void *param)
 
                        /* unlink the node -> the list will get shorter and it will be
                         * faster for the next branches to process it */
-                       ll->prev->prev->next = ll;
-                       ll->prev = ll->prev->prev;
+                       if(ll) {
+                               ll->prev->prev->next = ll;
+                               ll->prev = ll->prev->prev;
+                       }
                        node->expires = 0;
                        node->timer_ll.prev = node->timer_ll.next = 0;
                        if ( node->flags&NODE_EXPIRED_FLAG )