From e94d19c989fe7671c5826b88c163e7a97a19d1d6 Mon Sep 17 00:00:00 2001 From: Razvan Becheriu Date: Tue, 20 Feb 2024 10:56:43 +0200 Subject: [PATCH] [#3185] fixed access invalid iterator --- src/bin/perfdhcp/avalanche_scen.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/bin/perfdhcp/avalanche_scen.cc b/src/bin/perfdhcp/avalanche_scen.cc index a4b187869a..376952c35f 100644 --- a/src/bin/perfdhcp/avalanche_scen.cc +++ b/src/bin/perfdhcp/avalanche_scen.cc @@ -44,9 +44,10 @@ AvalancheScen::resendPackets(ExchangeType xchg_type) { auto start_time = pkt->getTimestamp(); int current_pkt_resent_cnt = 0; auto r_it = retrans.find(trans_id); - if (r_it != retrans.end()) { - start_time = (*start_times.find(trans_id)).second; - current_pkt_resent_cnt = (*r_it).second; + auto s_it = start_times.find(trans_id); + if (r_it != retrans.end() && s_it != start_times.end()) { + start_time = s_it->second; + current_pkt_resent_cnt = r_it->second; } else { start_times[trans_id] = start_time; }