archive/iso9660: skip empty filenames
Aparently, libcdio sometimes returns empty filenames, causing MPD crashes. This shouldn't really happen, and I consider this a libcdio bug - but if it happens, people blame MPD, so let's add a check. Closes https://github.com/MusicPlayerDaemon/MPD/issues/776
This commit is contained in:
parent
73a1f078a6
commit
8d34a1cfc6
2
NEWS
2
NEWS
@ -1,4 +1,6 @@
|
|||||||
ver 0.21.21 (not yet released)
|
ver 0.21.21 (not yet released)
|
||||||
|
* archive
|
||||||
|
- iso9660: skip empty file names to work around libcdio bug
|
||||||
* decoder
|
* decoder
|
||||||
- gme: ignore empty tags
|
- gme: ignore empty tags
|
||||||
* output
|
* output
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "input/InputStream.hxx"
|
#include "input/InputStream.hxx"
|
||||||
#include "fs/Path.hxx"
|
#include "fs/Path.hxx"
|
||||||
#include "util/RuntimeError.hxx"
|
#include "util/RuntimeError.hxx"
|
||||||
|
#include "util/StringCompare.hxx"
|
||||||
|
|
||||||
#include <cdio/iso9660.h>
|
#include <cdio/iso9660.h>
|
||||||
|
|
||||||
@ -93,7 +94,9 @@ Iso9660ArchiveFile::Visit(char *path, size_t length, size_t capacity,
|
|||||||
auto *statbuf = (iso9660_stat_t *)
|
auto *statbuf = (iso9660_stat_t *)
|
||||||
_cdio_list_node_data(entnode);
|
_cdio_list_node_data(entnode);
|
||||||
const char *filename = statbuf->filename;
|
const char *filename = statbuf->filename;
|
||||||
if (PathTraitsUTF8::IsSpecialFilename(filename))
|
if (StringIsEmpty(filename) ||
|
||||||
|
PathTraitsUTF8::IsSpecialFilename(filename))
|
||||||
|
/* skip empty names (libcdio bug?) */
|
||||||
/* skip special names like "." and ".." */
|
/* skip special names like "." and ".." */
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user