fix: session data was accessed when NULL resulting in crash (#1105)

This commit is contained in:
Supreeth Herle 2021-07-23 12:52:46 +05:30 committed by GitHub
parent 0c1a3d7f95
commit 362393d0ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -1175,11 +1175,13 @@ out:
}
/* Store this value in the session */
ret = fd_sess_state_store(smf_gx_reg, session, &sess_data);
ogs_assert(ret == 0);
ogs_assert(sess_data == NULL);
if (sess_data) {
ret = fd_sess_state_store(smf_gx_reg, session, &sess_data);
ogs_assert(ret == 0);
ogs_assert(sess_data == NULL);
}
ret = fd_msg_send(msg, NULL, NULL);
ret = fd_msg_send(msg, NULL, NULL);
ogs_assert(ret == 0);
ogs_session_data_free(&gx_message->session_data);