mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-10-15 09:00:54 +00:00
fix: missing checks and limits
This commit is contained in:
@@ -260,6 +260,11 @@ namespace client
|
||||
LogPrint (eLogError, "I2PControl: Malformed request, HTTP header expected");
|
||||
return; // TODO:
|
||||
}
|
||||
if (contentLength > I2P_CONTROL_MAX_CONTENT_LENGTH)
|
||||
{
|
||||
LogPrint (eLogError, "I2PControl: Content-Length ", contentLength, " exceeds maximum allowed size");
|
||||
return;
|
||||
}
|
||||
std::streamoff rem = contentLength + ss.tellg () - bytes_transferred; // more bytes to read
|
||||
while (rem > 0) // read in chunks to prevent buffer overflow
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user