drop a tunnel message shorter than an I2NP header

This commit is contained in:
PobreGato committed 2026-08-31 04:28:37 +03:00
1 parent 8dad408660
commit 4fdb8c7c83
1 file changed
+6
+6
View File
@@ -322,6 +322,12 @@ namespace tunnel
LogPrint (eLogInfo, "TunnelMessage: Message expired");
return;
}
if (msg.data->GetLength () < I2NP_HEADER_SIZE)
{
// GetPayloadLength subtracts the header size, a shorter message wraps it around
LogPrint (eLogError, "TunnelMessage: Message of ", msg.data->GetLength (), " bytes is shorter than I2NP header, dropped");
return;
}
uint8_t typeID = msg.data->GetTypeID ();
LogPrint (eLogDebug, "TunnelMessage: Handle fragment of ", msg.data->GetLength (), " bytes, msg type ", (int)typeID);