[sr-dev] git:master:97da6b1a: topoh: safety checks for couple of mandatory headers

Daniel-Constantin Mierla miconda at gmail.com
Fri Nov 23 08:51:56 CET 2018


Module: kamailio
Branch: master
Commit: 97da6b1a5f656db4a91c8909167706fc8ec3d932
URL: https://github.com/kamailio/kamailio/commit/97da6b1a5f656db4a91c8909167706fc8ec3d932

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2018-11-23T08:46:54+01:00

topoh: safety checks for couple of mandatory headers

- first via and call-id
- GH #1735

---

Modified: src/modules/topoh/topoh_mod.c

---

Diff:  https://github.com/kamailio/kamailio/commit/97da6b1a5f656db4a91c8909167706fc8ec3d932.diff
Patch: https://github.com/kamailio/kamailio/commit/97da6b1a5f656db4a91c8909167706fc8ec3d932.patch

---

diff --git a/src/modules/topoh/topoh_mod.c b/src/modules/topoh/topoh_mod.c
index 7bdc9a15c7..911c7dfe6e 100644
--- a/src/modules/topoh/topoh_mod.c
+++ b/src/modules/topoh/topoh_mod.c
@@ -286,6 +286,12 @@ int th_prepare_msg(sip_msg_t *msg)
 		return 3;
 	}
 
+	if(msg->via1==NULL || msg->callid==NULL) {
+		LM_ERR("mandatory headers missing - via1: %p callid: %p\n",
+				msg->via1, msg->callid);
+		return 4;
+	}
+
 	return 0;
 }
 




More information about the sr-dev mailing list