Commit f849b077 authored by Max Kellermann's avatar Max Kellermann

storage/curl: fix nullptr dereference

Pass a std::string to PathTraitsUTF8::Relative(), implicitly casting it to std::string_view. This selects the right overload which returns std::string_view instead of `const char *`; the latter could return `nullptr` which would cause the implicit conversion of the return value to std::string_view to crash. Regression caused by commits ead20898 and a98d627c. Closes https://github.com/MusicPlayerDaemon/MPD/issues/995
parent 2da3cff1
ver 0.22.3 (not yet released)
* playlist
- add option "as_directory", making CUE file expansion optional
* storage
- curl: fix crash bug
* filter
- fix garbage after "Audio format not supported by filter" message
- ffmpeg: support planar output
......
......@@ -80,7 +80,7 @@ std::string_view
CurlStorage::MapToRelativeUTF8(std::string_view uri_utf8) const noexcept
{
return PathTraitsUTF8::Relative(base,
CurlUnescape(uri_utf8).c_str());
CurlUnescape(uri_utf8));
}
class BlockingHttpRequest : protected CurlResponseHandler {
......
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