Skip to content

Commit a30ae8c

Browse files
committed
ArduinoOTA: fix buffer overflow in parseInt
fixes esp8266#3912
1 parent 1272a51 commit a30ae8c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libraries/ArduinoOTA/ArduinoOTA.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ void ArduinoOTAClass::begin() {
143143

144144
int ArduinoOTAClass::parseInt(){
145145
char data[16];
146-
uint8_t index = 0;
146+
uint8_t index;
147147
char value;
148148
while(_udp_ota->peek() == ' ') _udp_ota->read();
149-
while(true){
149+
for(index = 0; index < sizeof(data); ++index){
150150
value = _udp_ota->peek();
151151
if(value < '0' || value > '9'){
152152
data[index++] = '\0';

0 commit comments

Comments
 (0)