summaryrefslogtreecommitdiff
path: root/src/ipcpd
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2017-04-06 14:35:21 +0200
committerSander Vrijders <sander.vrijders@ugent.be>2017-04-06 14:35:21 +0200
commit7bfc2517b6f8f657511f186565732c65f0302b43 (patch)
treebff5b32ac5213b6d324c3ac3398016caf9ad2e23 /src/ipcpd
parent48c4840cbdf689bf1889dbf5d33afea118813b5a (diff)
downloadouroboros-7bfc2517b6f8f657511f186565732c65f0302b43.tar.gz
ouroboros-7bfc2517b6f8f657511f186565732c65f0302b43.zip
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.
Diffstat (limited to 'src/ipcpd')
-rw-r--r--src/ipcpd/normal/frct.c6
1 files changed, 5 insertions, 1 deletions
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;
}