[sr-dev] git:3.2: modules_k/presence Safety check for malformed Subscribe

Anca Vamanu anca.vamanu at 1and1.ro
Wed Apr 25 14:07:56 CEST 2012


Module: sip-router
Branch: 3.2
Commit: 176f35cc78167267524724b432abad74c7218a35
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=176f35cc78167267524724b432abad74c7218a35

Author: Anca Vamanu <anca.vamanu at 1and1.ro>
Committer: Anca Vamanu <anca.vamanu at 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,




More information about the sr-dev mailing list