mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-10-22 13:11:40 +00:00
check the whole block header fits before reading block size in SSU2 payload
This commit is contained in:
1 parent
184d6d0ff3
commit
cf7f15af0c
1 file changed
+3
-1
@@ -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++;
|
||||
|
||||
Reference in new issue
Block a user