summaryrefslogtreecommitdiff
path: root/src/input
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2020-04-08 23:36:49 +0200
committerMax Kellermann <max@musicpd.org>2020-04-08 23:37:32 +0200
commit9f8dc31b50aca20db24bcea32fea249b2ac658ba (patch)
treef84f835f268b4969cb6d9a5deeac86a80a14b8b9 /src/input
parentdb93bb996c885496bc2076b36b86b726ae0879ed (diff)
input/Plugin: copy protocols() to stack before using it
Fixes regression by commit 015cbff93da causing a crash bug because the iterators of two different temporaries were used.
Diffstat (limited to 'src/input')
-rw-r--r--src/input/InputPlugin.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/input/InputPlugin.cxx b/src/input/InputPlugin.cxx
index f66af0f48..a1070a58d 100644
--- a/src/input/InputPlugin.cxx
+++ b/src/input/InputPlugin.cxx
@@ -33,7 +33,8 @@ InputPlugin::SupportsUri(const char *uri) const noexcept
if (StringStartsWithIgnoreCase(uri, *i))
return true;
} else {
- return std::any_of(protocols().begin(), protocols().end(), [uri](const auto &schema)
+ const auto p = protocols();
+ return std::any_of(p.begin(), p.end(), [uri](const auto &schema)
{ return StringStartsWithIgnoreCase(uri, schema.c_str()); } );
}
return false;