Selaa lähdekoodia

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 vuotta sitten
vanhempi
commit
cc5f96f9c8
1 muutettua tiedostoa jossa 4 lisäystä ja 0 poistoa
  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) {