diff --git a/lib/src/upper/pdcp_entity.cc b/lib/src/upper/pdcp_entity.cc index c7970ddd6..d8bb0556f 100644 --- a/lib/src/upper/pdcp_entity.cc +++ b/lib/src/upper/pdcp_entity.cc @@ -168,6 +168,12 @@ void pdcp_entity::write_pdu(byte_buffer_t *pdu) log->info_hex(pdu->msg, pdu->N_bytes, "RX %s PDU, do_integrity = %s, do_encryption = %s", rrc->get_rb_name(lcid).c_str(), (do_integrity) ? "true" : "false", (do_encryption) ? "true" : "false"); + // Sanity check + if(pdu->N_bytes <= sn_len_bytes) { + pool->deallocate(pdu); + return; + } + // Handle DRB messages if (cfg.is_data) { uint32_t sn;