mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-10-22 13:11:40 +00:00
allocate bigger buffer for base64 decoding due to boost::beast bug
This commit is contained in:
1 parent
6aa07fff5f
commit
7a43997fde
1 file changed
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user