Module: sip-router
Branch: 4.0
Commit: d8739609c85cb00da9486b3f91d0c4834048485f
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d873960…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Wed Sep 4 13:04:23 2013 +0200
topoh: safety check for missing To header
- based on a patch by Michel de Weerd, FS#303
(cherry picked from commit 362d374a61953aee3cf9f96eadaef63c5f22763e)
---
modules/topoh/topoh_mod.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/modules/topoh/topoh_mod.c b/modules/topoh/topoh_mod.c
index e5e7058..28a53bb 100644
--- a/modules/topoh/topoh_mod.c
+++ b/modules/topoh/topoh_mod.c
@@ -228,12 +228,18 @@ int th_prepare_msg(sip_msg_t *msg)
return 3;
}
- if(get_to(msg)==NULL)
+ if(parse_to_header(msg)<0 || msg->to==NULL)
{
LM_ERR("cannot parse TO header\n");
return 3;
}
+ if(get_to(msg)==NULL)
+ {
+ LM_ERR("cannot get TO header\n");
+ return 3;
+ }
+
return 0;
}