diff options
author | Ryan Walklin <ryan@testtoast.com> | 2017-08-17 20:57:59 +1000 |
---|---|---|
committer | Ryan Walklin <ryan@testtoast.com> | 2017-08-17 21:25:03 +1000 |
commit | 9f16c798d02d23bccbf463b78bfb228ccc666e11 (patch) | |
tree | 3527a32790561e092efdd07b25cb1a6aaeadaf9a | |
parent | 318f80d113ee116507572f16bfa4ed9a2143b958 (diff) |
Fix std::string read after free in read_stream_art
-rw-r--r-- | src/command/FileCommands.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/command/FileCommands.cxx b/src/command/FileCommands.cxx index ac8e805e3..b8623395b 100644 --- a/src/command/FileCommands.cxx +++ b/src/command/FileCommands.cxx @@ -266,12 +266,12 @@ find_stream_art(const char *directory, Mutex &mutex, Cond &cond) static CommandResult read_stream_art(Response &r, const char *uri, size_t offset) { - const char *art_directory = PathTraitsUTF8::GetParent(uri).c_str(); + std::string art_directory = PathTraitsUTF8::GetParent(uri); Mutex mutex; Cond cond; - InputStreamPtr is = find_stream_art(art_directory, mutex, cond); + InputStreamPtr is = find_stream_art(art_directory.c_str(), mutex, cond); if (is == nullptr) { r.Error(ACK_ERROR_NO_EXIST, "No file exists"); |