From 3be8a872c638b81f39596a2fd5e9b0c43533e002 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Tue, 19 Sep 2023 13:46:46 +0200 Subject: ipcpd: Fix dereference of unknown pointer type The event handler was dereferencing the pointer to a connection, but the pointer type is not known yet. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/ipcpd/unicast/dt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ipcpd/unicast/dt.c b/src/ipcpd/unicast/dt.c index af2a6e29..2c166751 100644 --- a/src/ipcpd/unicast/dt.c +++ b/src/ipcpd/unicast/dt.c @@ -405,10 +405,9 @@ static void handle_event(void * self, c = (struct conn *) o; - fd = c->flow_info.fd; - switch (event) { case NOTIFY_DT_CONN_ADD: + fd = c->flow_info.fd; #ifdef IPCP_FLOW_STATS stat_used(fd, c->conn_info.addr); #endif @@ -416,6 +415,7 @@ static void handle_event(void * self, log_dbg("Added fd %d to packet scheduler.", fd); break; case NOTIFY_DT_CONN_DEL: + fd = c->flow_info.fd; #ifdef IPCP_FLOW_STATS stat_used(fd, INVALID_ADDR); #endif -- cgit v1.2.3