[sr-dev] git:4.3:a84d800c: pv: Fix crash when xavp has no attributes

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


Module: kamailio
Branch: 4.3
Commit: a84d800c491c7d05e7abec1f8fe169c6c52e8e62
URL: https://github.com/kamailio/kamailio/commit/a84d800c491c7d05e7abec1f8fe169c6c52e8e62

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

pv: Fix crash when xavp has no attributes
- Fixes the crash reported in #511
(cherry picked from commit 19bb634ba043e74480c724fb7ed8a2dad43e8dda)

---

Modified: modules/pv/pv_xavp.c

---

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

---

diff --git a/modules/pv/pv_xavp.c b/modules/pv/pv_xavp.c
index 53fd99a..3ef86fb 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