Module: sip-router
Branch: 3.2
Commit: 176f35cc78167267524724b432abad74c7218a35
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=176f35c…
Author: Anca Vamanu <anca.vamanu(a)1and1.ro>
Committer: Anca Vamanu <anca.vamanu(a)1and1.ro>
Date: Wed Apr 25 15:06:52 2012 +0300
modules_k/presence Safety check for malformed Subscribe
Subscribe with header 'Contact: *' caused crash in presence.
---
modules_k/presence/subscribe.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/modules_k/presence/subscribe.c b/modules_k/presence/subscribe.c
index 9db947e..b1405de 100644
--- a/modules_k/presence/subscribe.c
+++ b/modules_k/presence/subscribe.c
@@ -1078,6 +1078,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,