From: Francis Dupont Date: Tue, 16 Jul 2024 12:40:45 +0000 (+0200) Subject: [#3440] Added an empty check X-Git-Tag: Kea-2.7.1~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6a19add690f35b64b9b2c50e2d3f3e71abe30aeb;p=thirdparty%2Fkea.git [#3440] Added an empty check --- diff --git a/src/lib/dhcp/libdhcp++.cc b/src/lib/dhcp/libdhcp++.cc index 108d3cbfd3..64ec288b02 100644 --- a/src/lib/dhcp/libdhcp++.cc +++ b/src/lib/dhcp/libdhcp++.cc @@ -605,8 +605,7 @@ LibDHCP::unpackOptions4(const OptionBuffer& buf, const string& option_space, offset += opt_len; // Concatenate multiple instance of an option. - - if (counts.count(opt_type) > 0) { + if (!counts.empty() && (counts.count(opt_type) > 0)) { size_t count = counts[opt_type]; OptionBuffer& previous = fused[opt_type]; previous.insert(previous.end(), obuf.begin(), obuf.end());