Module: kamailio
Branch: master
Commit: 101670ac2c120cf0008a860b6a766aaa529e578d
URL:
https://github.com/kamailio/kamailio/commit/101670ac2c120cf0008a860b6a766aa…
Author: Henning Westerholt <hw(a)kamailio.org>
Committer: Henning Westerholt <hw(a)kamailio.org>
Date: 2019-02-25T16:47:30+01:00
topoh: improve checks for contact header processing
---
Modified: src/modules/topoh/th_msg.c
---
Diff:
https://github.com/kamailio/kamailio/commit/101670ac2c120cf0008a860b6a766aa…
Patch:
https://github.com/kamailio/kamailio/commit/101670ac2c120cf0008a860b6a766aa…
---
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);