Explorar o código

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 %!s(int64=10) %!d(string=hai) anos
pai
achega
cc5f96f9c8
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  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) {