archive/{zzip,iso9660}: ignore file names which are invalid UTF-8
These malformed strings must not be transferred over the wire, because the MPD protocol is defined to be UTF-8. Closes https://github.com/MusicPlayerDaemon/MPD/issues/1274
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
#include "fs/Path.hxx"
|
||||
#include "system/Error.hxx"
|
||||
#include "util/RuntimeError.hxx"
|
||||
#include "util/UTF8.hxx"
|
||||
|
||||
#include <zzip/zzip.h>
|
||||
|
||||
@@ -84,7 +85,7 @@ ZzipArchiveFile::Visit(ArchiveVisitor &visitor)
|
||||
ZZIP_DIRENT dirent;
|
||||
while (zzip_dir_read(dir->dir, &dirent))
|
||||
//add only files
|
||||
if (dirent.st_size > 0)
|
||||
if (dirent.st_size > 0 && ValidateUTF8(dirent.d_name))
|
||||
visitor.VisitArchiveEntry(dirent.d_name);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user