arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
21.73k stars 4.72k forks source link

Fixed void unwanted OTA upgrade when safeboot starts for the first time #21360

Closed s-hadinger closed 2 months ago

s-hadinger commented 2 months ago

Description:

When booting the first time on safeboot partition, an unwanted OTA upgrade from OtaURL would automatically be triggered. This is due to NvmLoad("otal", "otal", &pOtaLoader, sizeof(pOtaLoader)); not updating pOtaLoader since the value does not yet exist in NMV, hence the value would default to a random value from the stack, and generally not 0.

This PR sets the default value to 0 so no unwanted OTA is done when NVM is not yet populated.

Checklist:

NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass