forked from espressif/arduino-esp32
Fixes for zero length packet bug, buffer overflow in parseInt(), added end() method (#757)
* ArduinoOTA would stop receiving any packets if the port received a zero-length UDP packet, commonly sent by network scanners like nmap. Fixed to flush() after every call to parsePacket(), even if read length is 0. Additionally, added length checking to fix a potential buffer overflow in parseInt(). Finally, added an end() method that stops the OTA listener and releases resources. * Only end MDNS in end() if mdns mode is enabled.
This commit is contained in:
@ -5,6 +5,9 @@
|
||||
#include <functional>
|
||||
#include "Update.h"
|
||||
|
||||
#define INT_BUFFER_SIZE 16
|
||||
|
||||
|
||||
typedef enum {
|
||||
OTA_IDLE,
|
||||
OTA_WAITAUTH,
|
||||
@ -63,6 +66,9 @@ class ArduinoOTAClass
|
||||
//Starts the ArduinoOTA service
|
||||
void begin();
|
||||
|
||||
//Ends the ArduinoOTA service
|
||||
void end();
|
||||
|
||||
//Call this in loop() to run the service
|
||||
void handle();
|
||||
|
||||
|
Reference in New Issue
Block a user