[sr-dev] git:master:17e7d757: pv: Fix crash when xavp has no attributes

Hugh Waite hugh.waite at xura.com
Tue Feb 16 18:26:18 CET 2016


Module: kamailio
Branch: master
Commit: 17e7d757b04b6da5b5d4d2eb076ac746fcc0ee05
URL: https://github.com/kamailio/kamailio/commit/17e7d757b04b6da5b5d4d2eb076ac746fcc0ee05

Author: Hugh Waite <hugh.waite at xura.com>
Committer: Hugh Waite <hugh.waite at xura.com>
Date: 2016-02-16T17:25:14Z

pv: Fix crash when xavp has no attributes
- Fixes the crash reported in #511

---

Modified: modules/pv/pv_xavp.c

---

Diff:  https://github.com/kamailio/kamailio/commit/17e7d757b04b6da5b5d4d2eb076ac746fcc0ee05.diff
Patch: https://github.com/kamailio/kamailio/commit/17e7d757b04b6da5b5d4d2eb076ac746fcc0ee05.patch

---

diff --git a/modules/pv/pv_xavp.c b/modules/pv/pv_xavp.c
index 8c11426..67ffd45 100644
--- a/modules/pv/pv_xavp.c
+++ b/modules/pv/pv_xavp.c
@@ -111,6 +111,8 @@ int pv_get_xavp(struct sip_msg *msg, pv_param_t *param,
 		return pv_get_null(msg, param, res);
 	if(xname->next==NULL)
 		return pv_xavp_get_value(msg, param, res, avp);
+	if(avp->val.type != SR_XTYPE_XAVP)
+		return pv_get_null(msg, param, res);
 
 	idx = 0;
 	idxf = 0;




More information about the sr-dev mailing list