Explorar o código

core: safety check for linker when inserting xavp with index

Daniel-Constantin Mierla %!s(int64=10) %!d(string=hai) anos
pai
achega
ec438b4569
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      xavp.c

+ 4 - 0
xavp.c

@@ -732,6 +732,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;