diff options
author | Max Kellermann <max@musicpd.org> | 2020-04-08 23:36:49 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2020-04-08 23:37:32 +0200 |
commit | 9f8dc31b50aca20db24bcea32fea249b2ac658ba (patch) | |
tree | f84f835f268b4969cb6d9a5deeac86a80a14b8b9 /src/input | |
parent | db93bb996c885496bc2076b36b86b726ae0879ed (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.cxx | 3 |
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; |