浏览代码

topoh: safety check for Via header when removed from script

- reported by Guillaume Bour, FS#300
Daniel-Constantin Mierla 12 年之前
父节点
当前提交
b480ac5550
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      modules/topoh/th_msg.c

+ 5 - 0
modules/topoh/th_msg.c

@@ -967,6 +967,11 @@ int th_del_via_cookie(sip_msg_t *msg, struct via_body *via)
 {
 {
 	struct via_param *p;
 	struct via_param *p;
 	struct lump* l;
 	struct lump* l;
+
+	if(via==NULL) {
+		LM_DBG("no via header\n");
+		return 0;
+	}
 	for(p=via->param_lst; p; p=p->next)
 	for(p=via->param_lst; p; p=p->next)
 	{
 	{
 		if(p->name.len==th_cookie_name.len
 		if(p->name.len==th_cookie_name.len