[sr-dev] git:4.2:cd42ec08: core: safety check for linker when inserting xavp with index

Daniel-Constantin Mierla miconda at gmail.com
Tue May 19 09:36:49 CEST 2015


Module: kamailio
Branch: 4.2
Commit: cd42ec08027349be350b40e78bb5fff98ed32527
URL: https://github.com/kamailio/kamailio/commit/cd42ec08027349be350b40e78bb5fff98ed32527

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2015-05-19T09:35:33+02:00

core: safety check for linker when inserting xavp with index

(cherry picked from commit ec438b45696e17af0a3b19bb7ac12b221f897517)

---

Modified: xavp.c

---

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

---

diff --git a/xavp.c b/xavp.c
index f7cb360..3d12f49 100644
--- a/xavp.c
+++ b/xavp.c
@@ -733,6 +733,10 @@ int xavp_insert(sr_xavp_t *xavp, int idx, sr_xavp_t **list)
 		lst = crt;
 	}
 
+	if(lst==NULL) {
+		LM_ERR("cannot link the xavp\n");
+		return -1;
+	}
 	xavp->next = lst->next;
 	lst->next = xavp;
 




More information about the sr-dev mailing list