From 61e1b76abb37e97df41d85a9a9b045c6f17d1ab5 Mon Sep 17 00:00:00 2001 From: AlexPeshkoff Date: Tue, 4 May 2021 14:50:09 +0300 Subject: [PATCH] Avoid problems in case of buggy config with >1 Loopback in Providers --- src/common/security.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/common/security.cpp b/src/common/security.cpp index 73156d9161..00e8a7ad38 100644 --- a/src/common/security.cpp +++ b/src/common/security.cpp @@ -183,13 +183,12 @@ PathName ParsedList::getNonLoopbackProviders(const PathName& aliasDb) PathName providers(config->getPlugins(IPluginManager::TYPE_PROVIDER)); Auth::ParsedList list(providers); - for (unsigned n = 0; n < list.getCount(); ++n) + for (unsigned n = 0; n < list.getCount();) { if (list[n] == "Loopback") - { list.remove(n); - break; - } + else + ++n; } list.makeList(providers); providers.insert(0, "Providers=");