From b46554de6597ee9c7d7ab2f91af55fdac1be3928 Mon Sep 17 00:00:00 2001 From: orignal Date: Mon, 31 Aug 2026 16:12:40 -0400 Subject: [PATCH] correct incorrect block size for padding block --- libi2pd/NTCP2.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libi2pd/NTCP2.cpp b/libi2pd/NTCP2.cpp index efbc29f2..f601d16b 100644 --- a/libi2pd/NTCP2.cpp +++ b/libi2pd/NTCP2.cpp @@ -1283,8 +1283,14 @@ namespace transport LogPrint (eLogDebug, "NTCP2: Block type ", (int)blk, " of size ", size); if (offset + size > len) { - LogPrint (eLogError, "NTCP2: Unexpected block length ", size); - break; + if (blk == eNTCP2BlkPadding) + // padding is always last block and we set size up to end of frame + size = len - offset; + else + { + LogPrint (eLogError, "NTCP2: Unexpected block length ", size, " of type ", (int)blk); + break; + } } switch (blk) {