diff --git a/src/db/update/Archive.cxx b/src/db/update/Archive.cxx
index 9dee7dfdf..84b57d9ef 100644
--- a/src/db/update/Archive.cxx
+++ b/src/db/update/Archive.cxx
@@ -39,7 +39,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