added a bound checker to bit_ref packer, and other fixes

This commit is contained in:
Francisco Paisana 2019-09-17 10:49:40 +01:00 committed by Andre Puschmann
parent f74efe908b
commit 94667beb00
2 changed files with 2 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;
}