mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 00:00:29 +03:00
allow zero length padding
This commit is contained in:
parent
3458665df8
commit
f6ca7c19af
@ -2477,14 +2477,9 @@ namespace transport
|
||||
size_t paddingSize = rand () & 0x0F; // 0 - 15
|
||||
if (paddingSize + 3 > len) paddingSize = len - 3;
|
||||
else if (paddingSize + 3 < minSize) paddingSize = minSize - 3;
|
||||
if (paddingSize)
|
||||
{
|
||||
buf[0] = eSSU2BlkPadding;
|
||||
htobe16buf (buf + 1, paddingSize);
|
||||
memset (buf + 3, 0, paddingSize);
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
buf[0] = eSSU2BlkPadding;
|
||||
htobe16buf (buf + 1, paddingSize);
|
||||
memset (buf + 3, 0, paddingSize);
|
||||
return paddingSize + 3;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user