[sr-dev] git:master: modules/outbound: fixed segmentation fault

Peter Dunkley peter.dunkley at crocodile-rcs.com
Sat Mar 30 00:32:25 CET 2013


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

Author: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Date:   Fri Mar 29 23:31:39 2013 +0000

modules/outbound: fixed segmentation fault

---

 modules/outbound/api.h    |    2 +-
 modules/outbound/ob_mod.c |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/outbound/api.h b/modules/outbound/api.h
index 16c2f2e..2667fde 100644
--- a/modules/outbound/api.h
+++ b/modules/outbound/api.h
@@ -28,7 +28,7 @@
 #include "../../sr_module.h"
 
 typedef int (*encode_flow_token_t)(str *, struct receive_info);
-typedef int (*decode_flow_token_t)(struct sip_msg *, struct receive_info *, str);
+typedef int (*decode_flow_token_t)(struct sip_msg *, struct receive_info **, str);
 typedef int (*use_outbound_t)(struct sip_msg *);
 
 typedef struct ob_binds {
diff --git a/modules/outbound/ob_mod.c b/modules/outbound/ob_mod.c
index ed87320..6cbc6d7 100644
--- a/modules/outbound/ob_mod.c
+++ b/modules/outbound/ob_mod.c
@@ -185,7 +185,7 @@ int encode_flow_token(str *flow_token, struct receive_info rcv)
 	return 0;
 }
 
-int decode_flow_token(struct sip_msg *msg, struct receive_info *rcv, str flow_token)
+int decode_flow_token(struct sip_msg *msg, struct receive_info **rcv, str flow_token)
 {
 	int pos = FLOW_TOKEN_START_POS, flow_length, i;
 
@@ -262,7 +262,7 @@ int decode_flow_token(struct sip_msg *msg, struct receive_info *rcv, str flow_to
 	msg->flow.decoded = 1;
 
 end:
-	rcv = &msg->flow.rcv;
+	*rcv = &msg->flow.rcv;
 	return 0;
 }
 
@@ -361,7 +361,7 @@ static int use_outbound_non_reg(struct sip_msg *msg)
 			LM_INFO("found ;ob parameter on Route-URI - outbound"
 				" used\n");
 
-			if (decode_flow_token(msg, rcv, puri.user) == 0)
+			if (decode_flow_token(msg, &rcv, puri.user) == 0)
 			{
 				if (!ip_addr_cmp(&rcv->src_ip, &msg->rcv.src_ip)
 					|| rcv->src_port != msg->rcv.src_port)




More information about the sr-dev mailing list