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

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date:   Fri Dec  2 11:55:28 2011 +0100

tm: safety check to be sure t_release() is executed in request_route

- t_release() is intended for request_route block, but can be executed
  from other types of root routing block via subroute, causing a crash
- the fix ensures the root routing block is request_route
- reported by Jose Luis Millan, closes FS#184

---

 modules/tm/tm.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/modules/tm/tm.c b/modules/tm/tm.c
index 5e06470..20167bb 100644
--- a/modules/tm/tm.c
+++ b/modules/tm/tm.c
@@ -1286,6 +1286,12 @@ inline static int w_t_release(struct sip_msg* msg, char* 
str, char* str2)
        struct cell *t;
        int ret;
        
+       if(get_route_type()!=REQUEST_ROUTE)
+       {
+               LM_INFO("invalid usage - not in request route\n");
+               return -1;
+       }
+
        if (t_check( msg  , 0  )==-1) return -1;
        t=get_t();
        if ( t && t!=T_UNDEFINED ) {


_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to