[sr-dev] git:4.3:138a552c: cnxcc: more safety checks for call structure

Daniel-Constantin Mierla miconda at gmail.com
Wed Nov 25 14:21:34 CET 2015


Module: kamailio
Branch: 4.3
Commit: 138a552ce71c795f39ad6e35d815d182dc26e747
URL: https://github.com/kamailio/kamailio/commit/138a552ce71c795f39ad6e35d815d182dc26e747

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2015-11-25T14:11:56+01:00

cnxcc: more safety checks for call structure

(cherry picked from commit 6985a2953b0577ad8dff449c2e849f6ff15da01c)

---

Modified: modules/cnxcc/cnxcc_mod.c

---

Diff:  https://github.com/kamailio/kamailio/commit/138a552ce71c795f39ad6e35d815d182dc26e747.diff
Patch: https://github.com/kamailio/kamailio/commit/138a552ce71c795f39ad6e35d815d182dc26e747.patch

---

diff --git a/modules/cnxcc/cnxcc_mod.c b/modules/cnxcc/cnxcc_mod.c
index f24e8bd..456d497 100644
--- a/modules/cnxcc/cnxcc_mod.c
+++ b/modules/cnxcc/cnxcc_mod.c
@@ -889,14 +889,18 @@ void terminate_all_calls(credit_data_t *credit_data) {
 	credit_data->deallocating = 1;
 
 	clist_foreach_safe(credit_data->call_list, call, tmp, next) {
-		LM_DBG("Killing call with CID [%.*s]\n", call->sip_data.callid.len, call->sip_data.callid.s);
-
-		/*
-		 * Update number of calls forced to end
-		 */
-		_data.stats->dropped++;
-		terminate_call(call);
-		__free_call(call);
+		if(call->sip_data.callid.s!=NULL) {
+			LM_DBG("Killing call with CID [%.*s]\n", call->sip_data.callid.len, call->sip_data.callid.s);
+
+			/*
+			 * Update number of calls forced to end
+			 */
+			_data.stats->dropped++;
+			terminate_call(call);
+			__free_call(call);
+		} else {
+			LM_WARN("invalid call structure %p\n", call);
+		}
 	}
 }
 




More information about the sr-dev mailing list