srsenb/rrc: Avoid crash when CSFB requested but sib7 not configured

This commit addresses an issue where if a UE requests a release for
circuit switched fallback, but the sib7 carrier freqs info list is not
configured, the eNodeB would crash with a segfault due to attempting
to access an element from an empty list. This commit adds explicit
checking to handle the empty list case. If the list is empty, no
redirect carrier info is added to the connection release message and
the UE must scan for the fallback network itself.
master
Matt Johnson 4 years ago committed by Andre Puschmann
parent 1ff74da078
commit e9eab89a6b

@ -767,9 +767,13 @@ void rrc::ue::send_connection_release()
rrc_conn_release_r8_ies_s& rel_ies = rrc_release.crit_exts.set_c1().set_rrc_conn_release_r8();
rel_ies.release_cause = release_cause_e::other;
if (is_csfb) {
rel_ies.redirected_carrier_info_present = true;
rel_ies.redirected_carrier_info.set_geran();
rel_ies.redirected_carrier_info.geran() = parent->sib7.carrier_freqs_info_list[0].carrier_freqs;
if (parent->sib7.carrier_freqs_info_list.size() > 0) {
rel_ies.redirected_carrier_info_present = true;
rel_ies.redirected_carrier_info.set_geran();
rel_ies.redirected_carrier_info.geran() = parent->sib7.carrier_freqs_info_list[0].carrier_freqs;
} else {
rel_ies.redirected_carrier_info_present = false;
}
}
send_dl_dcch(&dl_dcch_msg);

Loading…
Cancel
Save