Commit 9f16c798 authored by Ryan Walklin's avatar Ryan Walklin

Fix std::string read after free in read_stream_art

parent 318f80d1
...@@ -266,12 +266,12 @@ find_stream_art(const char *directory, Mutex &mutex, Cond &cond) ...@@ -266,12 +266,12 @@ find_stream_art(const char *directory, Mutex &mutex, Cond &cond)
static CommandResult static CommandResult
read_stream_art(Response &r, const char *uri, size_t offset) 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; Mutex mutex;
Cond cond; 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) { if (is == nullptr) {
r.Error(ACK_ERROR_NO_EXIST, "No file exists"); r.Error(ACK_ERROR_NO_EXIST, "No file exists");
......
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