From 7bfc2517b6f8f657511f186565732c65f0302b43 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Thu, 6 Apr 2017 14:35:21 +0200 Subject: ipcpd: normal: Change assert to NULL check An assertion was done instead of NULL check, where the FRCT instance could legitimately be NULL, resulting in the IPCP dying when it shouldn't. --- src/ipcpd/normal/frct.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ipcpd/normal/frct.c b/src/ipcpd/normal/frct.c index 662a47d8..d873beae 100644 --- a/src/ipcpd/normal/frct.c +++ b/src/ipcpd/normal/frct.c @@ -234,7 +234,11 @@ int frct_nm1_post_sdu(struct pci * pci, id = instance->cep_id; } else { instance = frct.instances[pci->dst_cep_id]; - assert(instance); + if (instance == NULL) { + pthread_mutex_unlock(&frct.instances_lock); + ipcp_flow_del(sdb); + return -1; + } id = pci->dst_cep_id; instance->state = CONN_ESTABLISHED; } -- cgit v1.2.3