Commit 23d08820 authored by Max Kellermann's avatar Max Kellermann

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
parent b9b906ab
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 ...@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment