فهرست منبع

modules_k/presence and modules_k/rls Fixed parse_to() usage

In case of error parse_to returns a pointer to the last parsed character. This is not a strict
error check, as several other modules provide a relaxed way of parsing To header (the uri is still
parseable even if the TO headers are not).
Marius Zbihlei 15 سال پیش
والد
کامیت
957e2eb508
2فایلهای تغییر یافته به همراه4 افزوده شده و 2 حذف شده
  1. 2 1
      modules_k/presence/subscribe.c
  2. 2 1
      modules_k/rls/subscribe.c

+ 2 - 1
modules_k/presence/subscribe.c

@@ -798,7 +798,8 @@ int extract_sdialog_info(subs_t* subs,struct sip_msg* msg, int mexp,
 	else
 	{
 		memset( &TO , 0, sizeof(TO) );
-		if( !parse_to(msg->to->body.s,msg->to->body.s + msg->to->body.len + 1, &TO))
+		parse_to(msg->to->body.s,msg->to->body.s + msg->to->body.len + 1, &TO);
+		if( TO.uri.len <= 0 )
 		{
 			LM_DBG("'To' header NOT parsed\n");
 			goto error;

+ 2 - 1
modules_k/rls/subscribe.c

@@ -407,7 +407,8 @@ int rls_handle_subscribe(struct sip_msg* msg, char* s1, char* s2)
 	else
 	{
 		memset( &TO , 0, sizeof(TO) );
-		if( !parse_to(msg->to->body.s,msg->to->body.s+msg->to->body.len+1,&TO));
+		parse_to(msg->to->body.s,msg->to->body.s+msg->to->body.len+1,&TO);
+		if( TO.uri.len <= 0 )
 		{
 			LM_DBG("'To' header NOT parsed\n");
 			goto error;