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

Author: Andrei Pelinescu-Onciul <[email protected]>
Committer: Andrei Pelinescu-Onciul <[email protected]>
Date:   Tue Jul 14 07:36:19 2009 +0000

rr: fix from header access

get_from() can be used _only_ if parse_from_header() returned
success or if msg->from!=0.

---

 modules_s/rr/loose.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules_s/rr/loose.c b/modules_s/rr/loose.c
index da1e7df..25ebb07 100644
--- a/modules_s/rr/loose.c
+++ b/modules_s/rr/loose.c
@@ -420,8 +420,8 @@ static int get_direction(struct sip_msg* _m, str* _params) {
                ftag.len = s.s+i - ftag.s;
 
        if (ftag.len) {
-               parse_from_header(_m);          
-               if (get_from(_m)) {             /* compare if from.tag == ftag 
*/
+               if ((parse_from_header(_m)==0) && get_from(_m)) {
+                       /* compare if from.tag == ftag */
                        if (ftag.len!=get_from(_m)->tag_value.len || 
strncmp(ftag.s, get_from(_m)->tag_value.s, ftag.len)) return 1;
                }
        }


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

Reply via email to