Commit 96befa13 authored by Max Kellermann's avatar Max Kellermann

db/update/Archive: ignore filenames with newline character

parent 16a99804
......@@ -55,7 +55,9 @@ LockFindSong(Directory &directory, std::string_view name) noexcept
static bool
IsAcceptableFilename(std::string_view name) noexcept
{
return !name.empty();
return !name.empty() &&
/* newlines cannot be represented in MPD's protocol */
name.find('\n') == name.npos;
}
void
......
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