From 9e6c54ece86fe1afa3d3345cb9c890fe493817eb Mon Sep 17 00:00:00 2001 From: orignal Date: Thu, 17 Sep 2026 22:02:46 -0400 Subject: [PATCH] check next peer string length --- libi2pd_client/Torrents.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libi2pd_client/Torrents.cpp b/libi2pd_client/Torrents.cpp index 324a88a6..66db1305 100644 --- a/libi2pd_client/Torrents.cpp +++ b/libi2pd_client/Torrents.cpp @@ -2230,7 +2230,7 @@ namespace torrents { auto [idents, l] = ExtractByteString (buf); if (l && !(idents.size () & 0x1F)) // multiple of 32 - while (!idents.empty ()) + while (idents.length () >= i2p::data::IdentHash::len) { newPeers.emplace (i2p::data::IdentHash ((const uint8_t *)idents.substr (0, i2p::data::IdentHash::len).data ())); idents = idents.substr (i2p::data::IdentHash::len);