[sr-dev] git:master:4dc7b49f: pv_headers: pvh_set_header() fix core if $xavi not found

Victor Seva linuxmaniac at torreviejawireless.org
Wed Jul 1 11:22:27 CEST 2020


Module: kamailio
Branch: master
Commit: 4dc7b49f6b80305dc7c44d3dc95028ae282568ac
URL: https://github.com/kamailio/kamailio/commit/4dc7b49f6b80305dc7c44d3dc95028ae282568ac

Author: Victor Seva <linuxmaniac at torreviejawireless.org>
Committer: Victor Seva <linuxmaniac at torreviejawireless.org>
Date: 2020-07-01T11:18:39+02:00

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

---

Modified: src/modules/pv_headers/pvh_xavp.c

---

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

---

diff --git a/src/modules/pv_headers/pvh_xavp.c b/src/modules/pv_headers/pvh_xavp.c
index fa8ba791e3..ad5ba9ddac 100644
--- a/src/modules/pv_headers/pvh_xavp.c
+++ b/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) {




More information about the sr-dev mailing list