libi2pd: add missing length checks

This commit is contained in:
jpk68
2026-07-29 19:07:39 -04:00
parent 6d47cca978
commit b148455295
2 changed files with 21 additions and 1 deletions
+1 -1
View File
@@ -1299,7 +1299,7 @@ namespace transport
len = m_SessionConfirmedFragment->payloadSize + 16;
}
}
if (len < 80)
if (len < 83) // 64 bytes header/part1 + 16 bytes MAC + at least 1 byte block type + 2 bytes block size
{
LogPrint (eLogWarning, "SSU2: SessionConfirmed message too short ", len);
if (m_SessionConfirmedFragment) m_SessionConfirmedFragment.reset (nullptr);