From 55f5c820655c3b53863043569f05b97ad615abbc Mon Sep 17 00:00:00 2001 From: Henning Westerholt Date: Mon, 25 Feb 2019 16:45:42 +0100 Subject: [PATCH] topoh: improve checks for contact header processing (cherry picked from commit 101670ac2c120cf0008a860b6a766aaa529e578d) --- src/modules/topoh/th_msg.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/topoh/th_msg.c b/src/modules/topoh/th_msg.c index a3b6ab5f298..8b8d278b256 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);