[sr-dev] git:master: pv: reset the index for inner fields of xavp PV

Daniel-Constantin Mierla miconda at gmail.com
Sun Mar 6 11:41:54 CET 2011


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Sun Mar  6 11:38:35 2011 +0100

pv: reset the index for inner fields of xavp PV

- reported by Alex Hermann

---

 modules_k/pv/pv_xavp.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules_k/pv/pv_xavp.c b/modules_k/pv/pv_xavp.c
index 34dd91b..e706d04 100644
--- a/modules_k/pv/pv_xavp.c
+++ b/modules_k/pv/pv_xavp.c
@@ -99,7 +99,7 @@ int pv_get_xavp(struct sip_msg *msg, pv_param_t *param,
 	if(idx<0)
 	{
 		count = xavp_count(&xname->name, NULL);
-		idx = count + idx + 1;
+		idx = count + idx;
 	}
 	avp = xavp_get_by_index(&xname->name, idx, NULL);
 	if(avp==NULL)
@@ -107,6 +107,8 @@ int pv_get_xavp(struct sip_msg *msg, pv_param_t *param,
 	if(xname->next==NULL)
 		return pv_xavp_get_value(msg, param, res, avp);
 
+	idx = 0;
+	idxf = 0;
 	if(xname->next->index.type==PVT_EXTRA)
 	{
 		/* get the index */
@@ -120,7 +122,7 @@ int pv_get_xavp(struct sip_msg *msg, pv_param_t *param,
 	if(idx<0)
 	{
 		count = xavp_count(&xname->next->name, &avp->val.v.xavp);
-		idx = count + idx + 1;
+		idx = count + idx;
 	}
 	avp = xavp_get_by_index(&xname->next->name, idx, &avp->val.v.xavp);
 	if(avp==NULL)




More information about the sr-dev mailing list