1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-04 18:03:20 +03:00

if data loss, exit

This commit is contained in:
Górász Péter 2016-04-13 08:20:07 +02:00
parent 41bd7af07e
commit b72cf2cdcf

View File

@ -153,7 +153,13 @@ bool ESP8266WebServer::_parseRequest(WiFiClient& client) {
plainLen += newLen;
plainBuf[plainLen] = '\0';
} while (plainLen < contentLength);
/* if data loss, exit */
if (plainBuf == nullptr) return false;
if (plainLen < contentLength)
{
free(plainBuf);
return false;
}
#ifdef DEBUG_ESP_HTTP_SERVER
DEBUG_OUTPUT.print("Plain: ");
DEBUG_OUTPUT.println(plainBuf);