mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 21:37:17 +01: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;
|
||||
return paddingSize + 3;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue