Skip to content

Commit

Permalink
[SGWC] Fixed a crash
Browse files Browse the repository at this point in the history
  • Loading branch information
acetcom committed Jul 6, 2024
1 parent 3e10963 commit d6cc83b
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions src/sgwc/sxa-handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,19 +514,22 @@ void sgwc_sxa_handle_session_modification_response(
bearer_id <= OGS_MAX_POOL_ID);

bearer = sgwc_bearer_find_by_id(bearer_id);
ogs_assert(bearer);
if (!bearer) {
ogs_error("No Bearer Context");
cause_value = OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND;
} else {
if (!sess) {
ogs_error("No Context");

if (!sess) {
ogs_error("No Context");
sess = sgwc_sess_find_by_id(bearer->sess_id);
ogs_assert(sess);

sess = sgwc_sess_find_by_id(bearer->sess_id);
ogs_assert(sess);
cause_value = OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND;
}

cause_value = OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND;
sgwc_ue = sgwc_ue_find_by_id(bearer->sgwc_ue_id);
ogs_assert(sgwc_ue);
}

sgwc_ue = sgwc_ue_find_by_id(bearer->sgwc_ue_id);
ogs_assert(sgwc_ue);
}

if (pfcp_rsp->cause.presence) {
Expand Down Expand Up @@ -1404,7 +1407,10 @@ void sgwc_sxa_handle_session_deletion_response(
}

cleanup:
sgwc_sess_remove(sess);
if (sess)
sgwc_sess_remove(sess);
else
ogs_error("No Session");
}

void sgwc_sxa_handle_session_report_request(
Expand Down

0 comments on commit d6cc83b

Please sign in to comment.