From bcd8efb92627e84d2e08eef77c34ec8420290708 Mon Sep 17 00:00:00 2001 From: neo-one0873 <50387785+neo-one0873@users.noreply.github.com> Date: Tue, 27 Jun 2023 17:54:28 +0800 Subject: [PATCH] fix: array icmp_advert_entry_addr may out of bound when proxy_count=128, array icmp_advert_entry_addr and icmp_advert_entry_pref will out of bound. --- nping/NpingOps.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nping/NpingOps.cc b/nping/NpingOps.cc index 71cb4a5f0..c05a8860b 100644 --- a/nping/NpingOps.cc +++ b/nping/NpingOps.cc @@ -1895,7 +1895,7 @@ bool NpingOps::issetICMPTransmitTimestamp(){ int NpingOps::addICMPAdvertEntry(struct in_addr addr, u32 pref ){ - if( this->icmp_advert_entry_count > MAX_ICMP_ADVERT_ENTRIES ) + if( this->icmp_advert_entry_count >= MAX_ICMP_ADVERT_ENTRIES ) return OP_FAILURE; this->icmp_advert_entry_addr[this->icmp_advert_entry_count] = addr; this->icmp_advert_entry_pref[this->icmp_advert_entry_count] = pref;