mirror of
https://github.com/arduino-libraries/ArduinoHttpClient.git
synced 2025-04-19 21:22:15 +03:00
Make sure iContentLength doesn't wrap around due to malformed packets
This commit is contained in:
parent
6f2659de4c
commit
1a3fb989a5
@ -819,7 +819,11 @@ int HttpClient::readHeader()
|
|||||||
case eReadingContentLength:
|
case eReadingContentLength:
|
||||||
if (isdigit(c))
|
if (isdigit(c))
|
||||||
{
|
{
|
||||||
iContentLength = iContentLength*10 + (c - '0');
|
long _iContentLength = iContentLength*10 + (c - '0');
|
||||||
|
// Only apply if the value didn't wrap around
|
||||||
|
if (_iContentLength > iContentLength) {
|
||||||
|
iContentLength = _iContentLength;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user