Commit 9f8dc31b authored by Max Kellermann's avatar Max Kellermann

input/Plugin: copy protocols() to stack before using it

Fixes regression by commit 015cbff9 causing a crash bug because the iterators of two different temporaries were used.
parent db93bb99
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment