Explorar o código

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

Hugh Waite %!s(int64=9) %!d(string=hai) anos
pai
achega
17e7d757b0
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  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;