Browse code

pike: safety check for ll variable

(cherry picked from commit b123dec934769522407dad619bbb6c2074719884)
(cherry picked from commit ce30413e6e60c1674d7200c32469779398860c40)

Daniel-Constantin Mierla authored on 13/04/2021 07:50:07 • Henning Westerholt committed on 22/10/2021 11:51:34
Showing 1 changed files
... ...
@@ -211,8 +211,10 @@ void clean_routine(unsigned int ticks , void *param)
211 211
 
212 212
 			/* unlink the node -> the list will get shorter and it will be
213 213
 			 * faster for the next branches to process it */
214
-			ll->prev->prev->next = ll;
215
-			ll->prev = ll->prev->prev;
214
+			if(ll) {
215
+				ll->prev->prev->next = ll;
216
+				ll->prev = ll->prev->prev;
217
+			}
216 218
 			node->expires = 0;
217 219
 			node->timer_ll.prev = node->timer_ll.next = 0;
218 220
 			if ( node->flags&NODE_EXPIRED_FLAG )