From 900ee725b5c1d5fd3dfa8e198402cfe973fd2349 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Tue, 3 May 2022 16:22:21 +0200 Subject: [PATCH] server: Fix segfault in error path (client component ID != client) When we terminate the FSM instance, we must immediately return. Change-Id: I8dff45daa6584ed111a8469e7b3bf90e7c939612 --- src/server/rspro_server.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/server/rspro_server.c b/src/server/rspro_server.c index c003202..c4d4d79 100644 --- a/src/server/rspro_server.c +++ b/src/server/rspro_server.c @@ -138,6 +138,7 @@ static void clnt_st_established(struct osmo_fsm_inst *fi, uint32_t event, void * if (conn->comp_id.type != ComponentType_remsimClient) { LOGPFSML(fi, LOGL_ERROR, "ConnectClientReq from identity != Client ?!?\n"); osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); + return; } /* reparent us from srv->connections to srv->clients */ @@ -180,6 +181,7 @@ static void clnt_st_established(struct osmo_fsm_inst *fi, uint32_t event, void * if (conn->comp_id.type != ComponentType_remsimBankd) { LOGPFSML(fi, LOGL_ERROR, "ConnectBankReq from identity != Bank ?!?\n"); osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); + return; } /* FIXME: check for unique-ness */ conn->bank.bank_id = cbreq->bankId;