server: Fix segfault in error path (client component ID != client)

When we terminate the FSM instance, we must immediately return.

Change-Id: I8dff45daa6584ed111a8469e7b3bf90e7c939612
This commit is contained in:
Harald Welte 2022-05-03 16:22:21 +02:00
parent 079c068467
commit 900ee725b5
1 changed files with 2 additions and 0 deletions

View File

@ -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) { if (conn->comp_id.type != ComponentType_remsimClient) {
LOGPFSML(fi, LOGL_ERROR, "ConnectClientReq from identity != Client ?!?\n"); LOGPFSML(fi, LOGL_ERROR, "ConnectClientReq from identity != Client ?!?\n");
osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL);
return;
} }
/* reparent us from srv->connections to srv->clients */ /* 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) { if (conn->comp_id.type != ComponentType_remsimBankd) {
LOGPFSML(fi, LOGL_ERROR, "ConnectBankReq from identity != Bank ?!?\n"); LOGPFSML(fi, LOGL_ERROR, "ConnectBankReq from identity != Bank ?!?\n");
osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL);
return;
} }
/* FIXME: check for unique-ness */ /* FIXME: check for unique-ness */
conn->bank.bank_id = cbreq->bankId; conn->bank.bank_id = cbreq->bankId;