[sr-dev] git:5.1:be8c465c: topoh: improve checks for contact header processing

Henning Westerholt hw at kamailio.org
Mon Feb 25 16:48:47 CET 2019


Module: kamailio
Branch: 5.1
Commit: be8c465c591d54610b3de7fa2e8e5fda00863c0e
URL: https://github.com/kamailio/kamailio/commit/be8c465c591d54610b3de7fa2e8e5fda00863c0e

Author: Henning Westerholt <hw at kamailio.org>
Committer: Henning Westerholt <hw at kamailio.org>
Date: 2019-02-25T16:48:12+01:00

topoh: improve checks for contact header processing

(cherry picked from commit 101670ac2c120cf0008a860b6a766aaa529e578d)

---

Modified: src/modules/topoh/th_msg.c

---

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

---

diff --git a/src/modules/topoh/th_msg.c b/src/modules/topoh/th_msg.c
index a3b6ab5f29..8b8d278b25 100644
--- a/src/modules/topoh/th_msg.c
+++ b/src/modules/topoh/th_msg.c
@@ -275,6 +275,11 @@ int th_mask_contact(sip_msg_t *msg)
 	}
 
 	c = ((contact_body_t*)msg->contact->parsed)->contacts;
+	if(c == NULL)
+	{
+		LM_ERR("invalid contact header\n");
+		return -1;
+	}
 	in = c->uri;
 
 	out.s = th_mask_encode(in.s, in.len, &th_uri_prefix, &out.len);




More information about the sr-dev mailing list