playlist/flac: copy the URI to fix use-after-free bug

Closes https://github.com/MusicPlayerDaemon/MPD/issues/508
This commit is contained in:
Max Kellermann 2019-03-14 19:30:33 +01:00
parent 38f0c16904
commit 0d98677212
2 changed files with 3 additions and 1 deletions

2
NEWS
View File

@ -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)

View File

@ -34,7 +34,7 @@
#include <FLAC/metadata.h>
class FlacPlaylist final : public SongEnumerator {
const char *const uri;
const std::string uri;
FLAC__StreamMetadata *const cuesheet;
const unsigned sample_rate;