Merge pull request #2587 from pobregat0/ssu2-payload-block-header

Check the whole block header fits before reading block size in SSU2 payload
This commit is contained in:
orignal authored and GitHub committed 2026-10-06 20:29:17 -04:00
commit 58cdc528d4
1 file changed
+3 -1
+3 -1
View File
@@ -1780,7 +1780,9 @@ namespace transport
void SSU2Session::HandlePayload (const uint8_t * buf, size_t len)
{
size_t offset = 0;
while (offset < len)
// the block header is three bytes: without all of them the size field below
// would be read past the end of the payload
while (offset + 3 <= len)
{
uint8_t blk = buf[offset];
offset++;