db/update/Walk: fix crash when music_directory is not a directory
Add a runtime sanity check to avoid the assertion failure. Closes https://github.com/MusicPlayerDaemon/MPD/issues/660
This commit is contained in:
parent
b9b906ab20
commit
23d08820a2
2
NEWS
2
NEWS
@ -1,4 +1,6 @@
|
|||||||
ver 0.21.16 (not yet released)
|
ver 0.21.16 (not yet released)
|
||||||
|
* update
|
||||||
|
- fix crash when music_directory is not a directory
|
||||||
|
|
||||||
ver 0.21.15 (2019/09/25)
|
ver 0.21.15 (2019/09/25)
|
||||||
* decoder
|
* decoder
|
||||||
|
@ -493,6 +493,12 @@ UpdateWalk::Walk(Directory &root, const char *path, bool discard) noexcept
|
|||||||
if (!GetInfo(storage, "", info))
|
if (!GetInfo(storage, "", info))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (!info.IsDirectory()) {
|
||||||
|
FormatError(update_domain, "Not a directory: %s",
|
||||||
|
storage.MapUTF8("").c_str());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
ExcludeList exclude_list;
|
ExcludeList exclude_list;
|
||||||
|
|
||||||
UpdateDirectory(root, exclude_list, info);
|
UpdateDirectory(root, exclude_list, info);
|
||||||
|
Loading…
Reference in New Issue
Block a user