From 94667beb00e5da340677263b14985cd1e7c4ba3a Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Tue, 17 Sep 2019 10:49:40 +0100 Subject: [PATCH] added a bound checker to bit_ref packer, and other fixes --- lib/src/asn1/asn1_utils.cc | 2 +- srsue/src/stack/rrc/rrc.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/asn1/asn1_utils.cc b/lib/src/asn1/asn1_utils.cc index eb446414c..d9b1da4d1 100644 --- a/lib/src/asn1/asn1_utils.cc +++ b/lib/src/asn1/asn1_utils.cc @@ -106,7 +106,7 @@ int bit_ref::distance_bytes() const SRSASN_CODE bit_ref::pack(uint32_t val, uint32_t n_bits) { - if (n_bits > 32) { + if (n_bits >= 32) { srsasn_log_print(LOG_LEVEL_ERROR, "This method only supports packing up to 32 bits\n"); return SRSASN_ERROR_ENCODE_FAIL; } diff --git a/srsue/src/stack/rrc/rrc.cc b/srsue/src/stack/rrc/rrc.cc index 9118af272..c72d5e346 100644 --- a/srsue/src/stack/rrc/rrc.cc +++ b/srsue/src/stack/rrc/rrc.cc @@ -2446,7 +2446,7 @@ void rrc::apply_phy_scell_config(const asn1::rrc::scell_to_add_mod_r10_s* scell_ srslte_cell_t scell = {}; uint32_t earfcn = 0; - if (phy != nullptr) { + if (phy == nullptr) { rrc_log->info("RRC not initialized. Skipping PHY config.\n"); return; }