From 71355cebec5db2a6d56ac864104476adc069dcf4 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Tue, 6 Sep 2016 13:38:38 +0200 Subject: irmd: Fix register with unenrolled IPCPs in system If there are unregistered IPCPs (no DIF name set) the lookup should skip over them without segfaulting. --- src/irmd/main.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/irmd/main.c b/src/irmd/main.c index a4962c3b..8a05017a 100644 --- a/src/irmd/main.c +++ b/src/irmd/main.c @@ -212,6 +212,9 @@ static pid_t get_ipcp_by_dst_name(char * dst_name) list_for_each(p, &irmd->ipcps) { struct ipcp_entry * e = list_entry(p, struct ipcp_entry, next); + if (e->dif_name == NULL) + continue; + if (strcmp(e->dif_name, dif_name) == 0) return e->api; } -- cgit v1.2.3