2
0
Эх сурвалжийг харах

modules_k/presence Safety check for malformed Subscribe

	Subscribe with header 'Contact: *' caused crash in presence.
Anca Vamanu 13 жил өмнө
parent
commit
41453eab82

+ 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,