From 7a43997fdef5bc37398d09a09e368fd07d7da0af Mon Sep 17 00:00:00 2001 From: orignal Date: Sat, 10 Oct 2026 19:28:19 -0400 Subject: [PATCH] allocate bigger buffer for base64 decoding due to boost::beast bug --- libi2pd_client/TorrentsRPC.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libi2pd_client/TorrentsRPC.cpp b/libi2pd_client/TorrentsRPC.cpp index f6057cae..bbe62edc 100644 --- a/libi2pd_client/TorrentsRPC.cpp +++ b/libi2pd_client/TorrentsRPC.cpp @@ -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); }