fix termination block processing and size check

This commit is contained in:
Vort 2023-07-15 18:44:37 +03:00
parent 17c4038c60
commit ea7cf1cf69
2 changed files with 15 additions and 10 deletions

View file

@ -884,7 +884,7 @@ namespace transport
auto size = bufbe16toh (frame + offset);
offset += 2;
LogPrint (eLogDebug, "NTCP2: Block type ", (int)blk, " of size ", size);
if (size > len)
if (offset + size > len)
{
LogPrint (eLogError, "NTCP2: Unexpected block length ", size);
break;