From 0d98677212f7d4b1308f140b8979d32c6a96aad6 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 14 Mar 2019 19:30:33 +0100 Subject: [PATCH 1/3] playlist/flac: copy the URI to fix use-after-free bug Closes https://github.com/MusicPlayerDaemon/MPD/issues/508 --- NEWS | 2 ++ src/playlist/plugins/FlacPlaylistPlugin.cxx | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 37c351447..59e60e159 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ ver 0.21.6 (not yet released) - allow loading playlists specified as absolute filesystem paths * input - cdio_paranoia: fix build failure due to missing #include +* playlist + - flac: fix use-after-free bug * support abstract sockets on Linux ver 0.21.5 (2019/02/22) diff --git a/src/playlist/plugins/FlacPlaylistPlugin.cxx b/src/playlist/plugins/FlacPlaylistPlugin.cxx index cdaada6ae..c16b9d674 100644 --- a/src/playlist/plugins/FlacPlaylistPlugin.cxx +++ b/src/playlist/plugins/FlacPlaylistPlugin.cxx @@ -34,7 +34,7 @@ #include class FlacPlaylist final : public SongEnumerator { - const char *const uri; + const std::string uri; FLAC__StreamMetadata *const cuesheet; const unsigned sample_rate; From 59fdfd25cbfc82cd5bad92d26b9d904b8f81014b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 14 Mar 2019 19:50:09 +0100 Subject: [PATCH 2/3] command/database: fix "list" with filter expression Disable the 0.11 compatibility mode if the only argument is a filter expression. Closes https://github.com/MusicPlayerDaemon/MPD/issues/506 --- NEWS | 1 + src/command/DatabaseCommands.cxx | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 59e60e159..86f6d682e 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ ver 0.21.6 (not yet released) * protocol - allow loading playlists specified as absolute filesystem paths + - fix "list" with filter expression * input - cdio_paranoia: fix build failure due to missing #include * playlist diff --git a/src/command/DatabaseCommands.cxx b/src/command/DatabaseCommands.cxx index 907e2e6fb..6fc9fa8ac 100644 --- a/src/command/DatabaseCommands.cxx +++ b/src/command/DatabaseCommands.cxx @@ -268,7 +268,10 @@ handle_list(Client &client, Request args, Response &r) std::unique_ptr filter; TagType group = TAG_NUM_OF_ITEM_TYPES; - if (args.size == 1) { + if (args.size == 1 && + /* parantheses are the syntax for filter expressions: no + compatibility mode */ + args.front()[0] != '(') { /* for compatibility with < 0.12.0 */ if (tagType != TAG_ALBUM) { r.FormatError(ACK_ERROR_ARG, From 98b29f6d1c3d14ec2a6fd83f72c3b96f7a7ce171 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 14 Mar 2019 20:07:06 +0100 Subject: [PATCH 3/3] meson.build: remove the libwinpthread-1.dll dependency on Windows Closes https://github.com/MusicPlayerDaemon/MPD/issues/507 --- NEWS | 2 ++ src/thread/meson.build | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 86f6d682e..af3e6e142 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,8 @@ ver 0.21.6 (not yet released) * playlist - flac: fix use-after-free bug * support abstract sockets on Linux +* Windows + - remove the unused libwinpthread-1.dll dependency ver 0.21.5 (2019/02/22) * protocol diff --git a/src/thread/meson.build b/src/thread/meson.build index 241a3ed4e..408836481 100644 --- a/src/thread/meson.build +++ b/src/thread/meson.build @@ -1,4 +1,11 @@ -threads_dep = dependency('threads') +if is_windows + # avoid the unused libwinpthread-1.dll dependency on Windows; MPD + # doesn't use the pthread API on Windows, but this is what Meson + # unhelpfully detects for us + threads_dep = [] +else + threads_dep = dependency('threads') +endif conf.set('HAVE_PTHREAD_SETNAME_NP', compiler.has_function('pthread_setname_np', dependencies: threads_dep))