Module: sip-router
Branch: 3.1
Commit: 1303e86cc6000ca490c6363f9d01bea231e133a9
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1303e86…
Author: Anca Vamanu <anca.vamanu(a)1and1.ro>
Committer: Anca Vamanu <anca.vamanu(a)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.
(cherry picked from commit 41453eab823500cfc57abd404ecffeb3ed7f01bc)
---
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 23030a3..909bb23 100644
--- a/modules_k/presence/subscribe.c
+++ b/modules_k/presence/subscribe.c
@@ -912,6 +912,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,