From fe0dc77c034d45a1096000274104ac9a64171dbe Mon Sep 17 00:00:00 2001 From: Francisco Date: Tue, 25 May 2021 13:17:20 +0100 Subject: [PATCH] bugfix, s1ap: fix uninitialized variable access in s1ap_test --- srsenb/src/stack/s1ap/s1ap.cc | 4 ++-- srsenb/test/s1ap/s1ap_test.cc | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/srsenb/src/stack/s1ap/s1ap.cc b/srsenb/src/stack/s1ap/s1ap.cc index 2f722be92..7cb15c4a6 100644 --- a/srsenb/src/stack/s1ap/s1ap.cc +++ b/srsenb/src/stack/s1ap/s1ap.cc @@ -2107,7 +2107,7 @@ bool s1ap::ue::send_enb_status_transfer_proc(std::vector& be void s1ap::log_s1ap_msg(const asn1::s1ap::s1ap_pdu_c& msg, srsran::const_span sdu, bool is_rx) { - std::string msg_type; + const char* msg_type; switch (msg.type().value) { 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_spanerab_level_qos_params.alloc_retention_prio.pre_emption_vulnerability.value = asn1::s1ap::pre_emption_vulnerability_opts::not_pre_emptable; erab_ptr->nas_pdu.resize(1); - erab_list[1] = erab_list[0]; - 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->nas_pdu[0] = 0; + erab_list[1] = erab_list[0]; + 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; if (event == test_event::wrong_erabid_mod) { rrc.next_erabs_failed_to_modify.push_back(6); }