[sr-dev] git:ser_modules: rr: fix from header access

Andrei Pelinescu-Onciul andrei at iptel.org
Fri Jul 17 17:40:13 CEST 2009


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 <andrei at iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei at iptel.org>
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;
 		}
 	}




More information about the sr-dev mailing list