db/update/Archive: ignore filenames with newline character

This commit is contained in:
Max Kellermann 2023-04-30 08:41:59 +02:00
parent 16a99804de
commit 96befa138c

View File

@ -55,7 +55,9 @@ LockFindSong(Directory &directory, std::string_view name) noexcept
static bool static bool
IsAcceptableFilename(std::string_view name) noexcept 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 void