[MME] Follow-up on #2916

When there is no MME-UE Context, going to cleanup without setting
s6a_message could cause a segmentation fault.

We fixed the problem by moving the location of setting s6a_message
to before cleanup.
This commit is contained in:
Sukchan Lee 2024-02-08 18:46:45 +09:00
parent 290df460ef
commit 94bd68aa7b
1 changed files with 3 additions and 3 deletions

View File

@ -516,6 +516,9 @@ void mme_state_operational(ogs_fsm_t *s, mme_event_t *e)
break;
case MME_EVENT_S6A_MESSAGE:
s6a_message = e->s6a_message;
ogs_assert(s6a_message);
/*
* A race condition can occur in the following situations.
* In conclusion, we can use this situation to determine
@ -563,9 +566,6 @@ void mme_state_operational(ogs_fsm_t *s, mme_event_t *e)
goto cleanup;
}
s6a_message = e->s6a_message;
ogs_assert(s6a_message);
switch (s6a_message->cmd_code) {
case OGS_DIAM_S6A_CMD_CODE_AUTHENTICATION_INFORMATION:
ogs_debug("OGS_DIAM_S6A_CMD_CODE_AUTHENTICATION_INFORMATION");