diff --git a/cfgmgr/buffermgrdyn.cpp b/cfgmgr/buffermgrdyn.cpp index adc97e5734..56a227a708 100644 --- a/cfgmgr/buffermgrdyn.cpp +++ b/cfgmgr/buffermgrdyn.cpp @@ -325,10 +325,13 @@ void BufferMgrDynamic::loadZeroPoolAndProfiles() auto &poolObj = poolSearchRef->second; if (poolObj.zero_profile_name.empty()) { + if(poolObj.direction>= 0 && poolObj.direction <= 2) // ensuring the poolpbj.direction will not get out of boundaries + { poolObj.zero_profile_name = key; if (m_bufferZeroProfileName[poolObj.direction].empty()) m_bufferZeroProfileName[poolObj.direction] = poolObj.zero_profile_name; } + } else { SWSS_LOG_ERROR("Multiple zero profiles (%s, %s) detected for pool %s, takes the former and ignores the latter",