Commit 4bb83781 authored by Max Kellermann's avatar Max Kellermann

output/httpd/IcyMetaDataServer: cast length to unsigned

Fixes another buffer overflow: if the stream has a very long title or URL, resulting in a metadata string of more than 2 kB, icy_string[0] is a negative value, which gets casted to size_t - ouch! https://bugs.musicpd.org/view.php?id=4652
parent a73195b7
......@@ -3,6 +3,8 @@ ver 0.20.5 (not yet released)
- id3: fix memory leak on corrupt ID3 tags
* decoder
- sidplay: don't require libsidutils when building with libsidplayfp
* output
- httpd: fix two buffer overflows in IcyMetaData length calculation
* mixer
- alsa: fix crash bug
......
......@@ -113,5 +113,5 @@ icy_server_metadata_page(const Tag &tag, const TagType *types)
if (icy_string.IsNull())
return nullptr;
return Page::Copy(icy_string.c_str(), (icy_string[0] * 16) + 1);
return Page::Copy(icy_string.c_str(), uint8_t(icy_string[0]) * 16 + 1);
}
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