mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-09-02 06:53:58 +00:00
fail on a truncated chunk instead of returning uninitialized bytes
This commit is contained in:
@@ -616,6 +616,11 @@ namespace http
|
||||
return false; /* too large chunk */
|
||||
char * buf = new char[len];
|
||||
in.read (buf, len);
|
||||
if (in.gcount () != len) /* chunk is shorter than announced */
|
||||
{
|
||||
delete[] buf;
|
||||
return false;
|
||||
}
|
||||
out.write (buf, len);
|
||||
delete[] buf;
|
||||
std::getline (in, hexLen); // read \r\n after chunk
|
||||
|
||||
Reference in New Issue
Block a user