浏览代码

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 年之前
父节点
当前提交
c87a75c5fb
共有 1 个文件被更改,包括 1 次插入1 次删除
  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); */
 	/* LM_DBG("entering (%d)\n",ticks); */
 	/* before locking check first if the list is not empty and if can
 	/* before locking check first if the list is not empty and if can
 	 * be at least one element removed */
 	 * 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 */
 	/* get the expired elements */
 	lock_get( timer_lock );
 	lock_get( timer_lock );