allocate bigger buffer for base64 decoding due to boost::beast bug

This commit is contained in:
orignal committed 2026-10-10 19:28:19 -04:00
1 parent 6aa07fff5f
commit 7a43997fde
1 file changed
+1 -1
+1 -1
View File
@@ -168,7 +168,7 @@ namespace torrents
{
auto b64torrent = arguments.at ("metainfo").as_string ();
std::string torrentFileContent;
torrentFileContent.resize (boost::beast::detail::base64::decoded_size (b64torrent.size ()));
torrentFileContent.resize (boost::beast::detail::base64::decoded_size (b64torrent.size ()) + (b64torrent.size () % 4) * 3 / 4); // bug #3115 in boost::beast, TODO: shouls be fixed in boost >= 1.93
boost::beast::detail::base64::decode (torrentFileContent.data (), b64torrent.data (), b64torrent.size ());
std::tie (torrent, id) = m_Tunnel->AddTorrent (torrentFileContent);
}