Browse Source

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

Hugh Waite 9 năm trước cách đây
mục cha
commit
17e7d757b0
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      modules/pv/pv_xavp.c

+ 2 - 0
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;