Ver Fonte

topoh: improve checks for contact header processing

(cherry picked from commit 101670ac2c120cf0008a860b6a766aaa529e578d)
Henning Westerholt há 6 anos atrás
pai
commit
d3d5fcbe57
1 ficheiros alterados com 5 adições e 0 exclusões
  1. 5 0
      src/modules/topoh/th_msg.c

+ 5 - 0
src/modules/topoh/th_msg.c

@@ -267,6 +267,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);