Explorar el Código

core: safety check for linker when inserting xavp with index

Daniel-Constantin Mierla hace 10 años
padre
commit
ec438b4569
Se han modificado 1 ficheros con 4 adiciones y 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;