From efddec646d392904e36c21787a0ebdab66c54e3b Mon Sep 17 00:00:00 2001 From: technyon Date: Fri, 17 Jun 2022 23:15:48 +0200 Subject: [PATCH] prevent OTA when filename is empty --- WebCfgServer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/WebCfgServer.cpp b/WebCfgServer.cpp index 5034423..ac9810b 100644 --- a/WebCfgServer.cpp +++ b/WebCfgServer.cpp @@ -716,6 +716,13 @@ void WebCfgServer::handleOtaUpload() esp_task_wdt_init(30, false); HTTPUpload& upload = _server.upload(); + + if(upload.filename == "") + { + Serial.println("Invalid file for OTA upload"); + return; + } + if (upload.status == UPLOAD_FILE_START) { String filename = upload.filename; if (!filename.startsWith("/")) {