From e8b4e971f92425c6601883c0d6f21819e5f268d5 Mon Sep 17 00:00:00 2001 From: Chad Fraleigh Date: Wed, 5 Jul 2023 15:51:47 -0700 Subject: [PATCH] Added bounds checking to NetDb::HandleDatabaseSearchReplyMsg(). --- libi2pd/NetDb.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libi2pd/NetDb.cpp b/libi2pd/NetDb.cpp index ca048bec..9fa3123d 100644 --- a/libi2pd/NetDb.cpp +++ b/libi2pd/NetDb.cpp @@ -952,6 +952,10 @@ namespace data else if(!m_FloodfillBootstrap) LogPrint (eLogWarning, "NetDb: Requested destination for ", key, " not found"); + // All peers hashs in buffer? + if(msg->GetPayloadLength() < (size_t) (33 + num * IDENTITY_HASH_SIZE)) + return; + // try responses for (int i = 0; i < num; i++) {