Explorar el Código

pua: safety check for params values

Daniel-Constantin Mierla hace 7 años
padre
commit
a009a5bf4f
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      src/modules/pua/send_subscribe.c

+ 2 - 2
src/modules/pua/send_subscribe.c

@@ -803,7 +803,7 @@ ua_pres_t* subscribe_cbparam(subs_info_t* subs, int ua_flag)
 	hentity->contact.len= subs->contact->len;
 	size+= subs->contact->len;
 
-	if(subs->outbound_proxy)
+	if(subs->outbound_proxy && subs->outbound_proxy->s)
 	{
 		hentity->outbound_proxy= (str*)((char*)hentity+ size);
 		size+= sizeof(str);
@@ -821,7 +821,7 @@ ua_pres_t* subscribe_cbparam(subs_info_t* subs, int ua_flag)
 	{
 		CONT_COPY(hentity, hentity->id, subs->id);
 	}
-	if(subs->extra_headers)
+	if(subs->extra_headers && hentity->extra_headers->s)
 	{
 		hentity->extra_headers= (str*)((char*)hentity+ size);
 		size+= sizeof(str);