From 4f7cab202530ddf208774edf2c094567c2d11358 Mon Sep 17 00:00:00 2001 From: Jorg Neves Bliesener Date: Sun, 26 Jul 2020 18:06:46 +0200 Subject: [PATCH 1/2] Initialize _ledPin _ledPin should be initialized to -1 in the constructor to avoid setting a random pin when calling Updater::end without having called Updater::begin before. This happens, for example, in the Homie software --- cores/esp8266/Updater.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/cores/esp8266/Updater.cpp b/cores/esp8266/Updater.cpp index 351a57746b..0ec3b5d002 100644 --- a/cores/esp8266/Updater.cpp +++ b/cores/esp8266/Updater.cpp @@ -38,6 +38,7 @@ UpdaterClass::UpdaterClass() , _hash(nullptr) , _verify(nullptr) , _progress_callback(nullptr) +, _ledPin(-1) { #if ARDUINO_SIGNING installSignature(&esp8266::updaterSigningHash, &esp8266::updaterSigningVerifier); From fcdbe4dcde6b1f9c55b17518bb6eb4bb230fa491 Mon Sep 17 00:00:00 2001 From: Jorg Neves Bliesener Date: Sun, 26 Jul 2020 18:15:55 +0200 Subject: [PATCH 2/2] Fix field sequence Initialize _ledPin, see previous commit. Fix field sequence. --- cores/esp8266/Updater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/esp8266/Updater.cpp b/cores/esp8266/Updater.cpp index 0ec3b5d002..03bc5c3f8f 100644 --- a/cores/esp8266/Updater.cpp +++ b/cores/esp8266/Updater.cpp @@ -35,10 +35,10 @@ UpdaterClass::UpdaterClass() , _startAddress(0) , _currentAddress(0) , _command(U_FLASH) +, _ledPin(-1) , _hash(nullptr) , _verify(nullptr) , _progress_callback(nullptr) -, _ledPin(-1) { #if ARDUINO_SIGNING installSignature(&esp8266::updaterSigningHash, &esp8266::updaterSigningVerifier);