From 37215238100605c3f1cf81369640cb6226e2a70c Mon Sep 17 00:00:00 2001 From: Francisco Date: Sun, 10 Oct 2021 19:45:04 +0100 Subject: [PATCH] pdcp,lte: fix debug logging in PDCP, to avoid segmentation fault and crash --- lib/src/pdcp/pdcp_entity_lte.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/src/pdcp/pdcp_entity_lte.cc b/lib/src/pdcp/pdcp_entity_lte.cc index d4be424e1..017b45123 100644 --- a/lib/src/pdcp/pdcp_entity_lte.cc +++ b/lib/src/pdcp/pdcp_entity_lte.cc @@ -472,10 +472,14 @@ void pdcp_entity_lte::update_rx_counts_queue(uint32_t rx_count) rx_counts_info.pop_back(); fmc++; } - logger.debug("Queue too large. Updating. New FMC=%d, new back=%d, new queue_size=%zu", - fmc, - rx_counts_info.back(), - rx_counts_info.size()); + if (not rx_counts_info.empty()) { + logger.debug("Queue too large. Updating. New FMC=%d, new back=%d, new queue_size=%zu", + fmc, + rx_counts_info.back(), + rx_counts_info.size()); + } else { + logger.debug("Queue too large. Updating. New FMC=%d, new queue_size=%zu", fmc, rx_counts_info.size()); + } } if (rx_counts_info.empty()) {