Prechádzať zdrojové kódy

pv_headers: pvh_set_header() fix core if $xavi not found

Victor Seva 5 rokov pred
rodič
commit
4dc7b49f6b
1 zmenil súbory, kde vykonal 4 pridanie a 1 odobranie
  1. 4 1
      src/modules/pv_headers/pvh_xavp.c

+ 4 - 1
src/modules/pv_headers/pvh_xavp.c

@@ -603,7 +603,10 @@ int pvh_set_header(
 		return -1;
 	}
 
-	xavi = pvh_get_xavi(msg, &xavi_name);
+	if((xavi = pvh_get_xavi(msg, &xavi_name)) == NULL) {
+		LM_ERR("xavi %.*s not found\n", xavi_name.len, xavi_name.s);
+		return -1;
+	}
 	avi = xavi->val.v.xavp;
 	hname_cnt = xavi_count(hname, &avi);
 	if(hname_cnt == 0) {