libi2pd: add missing length checks

This commit is contained in:
jpk68 committed 2026-07-29 19:07:39 -04:00
1 parent 6d47cca978
commit b148455295
2 files changed
+21 -1

No files matched your search

+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);