فهرست منبع

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,