Commit 1417578b authored by Max Kellermann's avatar Max Kellermann

db/update/Archive: validate directory names

Fixes assertion failure if the ZIP file contains a path that begins with a slash. Closes https://github.com/MusicPlayerDaemon/MPD/issues/1793
parent 96befa13
ver 0.23.13 (not yet released)
* input
- curl: fix busy loop after connection failed
* archive
- zzip: fix crash bug
* decoder
- gme: require GME 0.6 or later
* output
......
......@@ -67,6 +67,9 @@ UpdateWalk::UpdateArchiveTree(ArchiveFile &archive, Directory &directory,
const char *tmp = std::strchr(name, '/');
if (tmp) {
const std::string_view child_name(name, tmp - name);
if (!IsAcceptableFilename(child_name))
return;
//add dir is not there already
Directory *subdir = LockMakeChild(directory, child_name);
subdir->device = DEVICE_INARCHIVE;
......
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