浏览代码

topoh: improve checks for contact header processing

(cherry picked from commit 101670ac2c120cf0008a860b6a766aaa529e578d)
Henning Westerholt 6 年之前
父节点
当前提交
d3d5fcbe57
共有 1 个文件被更改,包括 5 次插入0 次删除
  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);