[sr-dev] git:4.0: topoh: safety check for missing To header
Daniel-Constantin Mierla
miconda at gmail.com
Wed Sep 4 13:06:57 CEST 2013
Module: sip-router
Branch: 4.0
Commit: d8739609c85cb00da9486b3f91d0c4834048485f
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d8739609c85cb00da9486b3f91d0c4834048485f
Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at 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;
}
More information about the sr-dev
mailing list