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

Anca Vamanu anca.vamanu at 1and1.ro
Wed Apr 25 13:58:50 CEST 2012


Module: sip-router
Branch: master
Commit: 41453eab823500cfc57abd404ecffeb3ed7f01bc
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=41453eab823500cfc57abd404ecffeb3ed7f01bc

Author: Anca Vamanu <anca.vamanu at 1and1.ro>
Committer: Anca Vamanu <anca.vamanu at 1and1.ro>
Date:   Wed Apr 25 14:55:54 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 19192fe..161a2a0 100644
--- a/modules_k/presence/subscribe.c
+++ b/modules_k/presence/subscribe.c
@@ -1115,6 +1115,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