浏览代码

modules_k/presence Safety check for malformed Subscribe

	Subscribe with header 'Contact: *' caused crash in presence.
Anca Vamanu 13 年之前
父节点
当前提交
41453eab82
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      modules_k/presence/subscribe.c

+ 6 - 0
modules_k/presence/subscribe.c

@@ -1115,6 +1115,12 @@ int extract_sdialog_info(subs_t* subs,struct sip_msg* msg, int mexp,
 		LM_ERR("cannot parse contact header\n");
 		goto error;
 	}
+	if(b->star || b->contacts==NULL)
+	{
+		LM_ERR("Wrong contact header\n");
+		goto error;
+	}
+
 	subs->contact = b->contacts->uri;
 	
 	LM_DBG("subs->contact= %.*s - len = %d\n",subs->contact.len,