bugfix, s1ap: fix uninitialized variable access in s1ap_test

master
Francisco 4 years ago committed by Andre Puschmann
parent 297a2394b8
commit fe0dc77c03

@ -2107,7 +2107,7 @@ bool s1ap::ue::send_enb_status_transfer_proc(std::vector<bearer_status_info>& be
void s1ap::log_s1ap_msg(const asn1::s1ap::s1ap_pdu_c& msg, srsran::const_span<uint8_t> sdu, bool is_rx) void s1ap::log_s1ap_msg(const asn1::s1ap::s1ap_pdu_c& msg, srsran::const_span<uint8_t> sdu, bool is_rx)
{ {
std::string msg_type; const char* msg_type;
switch (msg.type().value) { switch (msg.type().value) {
case s1ap_pdu_c::types_opts::init_msg: case s1ap_pdu_c::types_opts::init_msg:
@ -2124,7 +2124,7 @@ void s1ap::log_s1ap_msg(const asn1::s1ap::s1ap_pdu_c& msg, srsran::const_span<ui
return; return;
} }
logger.info(sdu.data(), sdu.size(), "%s S1AP SDU - %s", is_rx ? "Rx" : "Tx", msg_type.c_str()); logger.info(sdu.data(), sdu.size(), "%s S1AP SDU - %s", is_rx ? "Rx" : "Tx", msg_type);
} }
} // namespace srsenb } // namespace srsenb

@ -250,6 +250,7 @@ void test_s1ap_erab_setup(test_event event)
erab_ptr->erab_level_qos_params.alloc_retention_prio.pre_emption_vulnerability.value = erab_ptr->erab_level_qos_params.alloc_retention_prio.pre_emption_vulnerability.value =
asn1::s1ap::pre_emption_vulnerability_opts::not_pre_emptable; asn1::s1ap::pre_emption_vulnerability_opts::not_pre_emptable;
erab_ptr->nas_pdu.resize(1); erab_ptr->nas_pdu.resize(1);
erab_ptr->nas_pdu[0] = 0;
erab_list[1] = erab_list[0]; erab_list[1] = erab_list[0];
erab_ptr = &erab_list[1].value.erab_to_be_modified_item_bearer_mod_req(); erab_ptr = &erab_list[1].value.erab_to_be_modified_item_bearer_mod_req();
erab_ptr->erab_id = event == test_event::repeated_erabid_mod ? 5 : 6; erab_ptr->erab_id = event == test_event::repeated_erabid_mod ? 5 : 6;

Loading…
Cancel
Save