This is an automated email from the ASF dual-hosted git repository. shinrich pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push: new cc1376f Fix set manipulation in dual cert resolution (#6758) cc1376f is described below commit cc1376fff1bcbda7329d21c22e8cb8ecdaad3950 Author: Susan Hinrichs <shinr...@yahoo-inc.com> AuthorDate: Tue May 12 10:35:09 2020 -0500 Fix set manipulation in dual cert resolution (#6758) Co-authored-by: Susan Hinrichs <shinr...@verizonmedia.com> --- iocore/net/SSLUtils.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/iocore/net/SSLUtils.cc b/iocore/net/SSLUtils.cc index 39a160d..c865d49 100644 --- a/iocore/net/SSLUtils.cc +++ b/iocore/net/SSLUtils.cc @@ -2031,23 +2031,26 @@ SSLMultiCertConfigLoader::load_certs_and_cross_reference_names(std::vector<X509 common_names = name_set; } else { // Check that all elements in common_names are in name_set - for (auto name : common_names) { - auto iter = name_set.find(name); + auto common_iter = common_names.begin(); + while (common_iter != common_names.end()) { + auto iter = name_set.find(*common_iter); if (iter == name_set.end()) { // Common_name not in new set, move name to unique set auto iter = unique_names.find(cert_index - 1); if (iter == unique_names.end()) { std::set<std::string> new_set; - new_set.insert(name); + new_set.insert(*common_iter); unique_names.insert({cert_index - 1, new_set}); } else { - iter->second.insert(name); + iter->second.insert(*common_iter); } - auto erase_iter = common_names.find(name); + auto erase_iter = common_iter; + ++common_iter; common_names.erase(erase_iter); } else { // New name already in common set, go ahead and remove it from further consideration name_set.erase(iter); + ++common_iter; } } // Anything still in name_set was not in common_names