Module: sip-router
Branch: master
Commit: 957e2eb50879dbddb1f9a53e04609cfc0c67a178
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=957e2eb…
Author: Marius Zbihlei <marius.zbihlei(a)1and1.ro>
Committer: Marius Zbihlei <marius.zbihlei(a)1and1.ro>
Date: Mon Jul 26 17:39:18 2010 +0300
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).
---
modules_k/presence/subscribe.c | 3 ++-
modules_k/rls/subscribe.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/modules_k/presence/subscribe.c b/modules_k/presence/subscribe.c
index 55e0271..c6f4aa2 100644
--- a/modules_k/presence/subscribe.c
+++ b/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;
diff --git a/modules_k/rls/subscribe.c b/modules_k/rls/subscribe.c
index eae3bf7..783cf87 100644
--- a/modules_k/rls/subscribe.c
+++ b/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;