fix: missing checks and limits

This commit is contained in:
jpk68
2026-09-16 08:47:15 -04:00
parent 8c833634ca
commit 5e93f74e19
9 changed files with 46 additions and 8 deletions
+5
View File
@@ -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
{