Przeglądaj źródła

pike: check that timer var is initialized before accessing the fields

- safe start with empty config, reported by Olle E. Johansson, GH#39
Daniel-Constantin Mierla 10 lat temu
rodzic
commit
c87a75c5fb
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      modules/pike/pike_funcs.c

+ 1 - 1
modules/pike/pike_funcs.c

@@ -172,7 +172,7 @@ void clean_routine(unsigned int ticks , void *param)
 	/* LM_DBG("entering (%d)\n",ticks); */
 	/* before locking check first if the list is not empty and if can
 	 * be at least one element removed */
-	if ( is_list_empty( timer )) return; /* quick exit */
+	if (timer==0 || is_list_empty( timer )) return; /* quick exit */
 
 	/* get the expired elements */
 	lock_get( timer_lock );