topoh: improve checks for contact header processing
authorHenning Westerholt <hw@kamailio.org>
Mon, 25 Feb 2019 15:45:42 +0000 (16:45 +0100)
committerHenning Westerholt <hw@kamailio.org>
Mon, 25 Feb 2019 15:47:30 +0000 (16:47 +0100)
src/modules/topoh/th_msg.c

index a3b6ab5..8b8d278 100644 (file)
@@ -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);