浏览代码

dmq: safety check for peer_list when calling the callbacks

- can result in crashing if it is not set
- reported by Olle E. Johansson
Daniel-Constantin Mierla 10 年之前
父节点
当前提交
cc5f96f9c8
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      modules/dmq/notification_peer.c

+ 4 - 0
modules/dmq/notification_peer.c

@@ -173,6 +173,10 @@ error:
 int run_init_callbacks() {
 	dmq_peer_t* crt;
 
+	if(peer_list==0) {
+		LM_WARN("peer list is null\n");
+		return 0;
+	}
 	crt = peer_list->peers;
 	while(crt) {
 		if (crt->init_callback) {