Skip to content

Commit 2171a2e

Browse files
Fix gzip+signed OTA error (#7577)
The last 4 bytes of a GZIP file is the decompressed file length, and are used in eboot to do sanity checks and know when decompression is done. Updater was incorrectly telling eboot to look at "end-of-bin + sizeof(signing)", and when eboot did so it got an incorrect value causing either the update to be skipped or for only a portion of update to be completed. Fix by adjusting the size back to the end of binary. Fixes #7570
1 parent 22a197e commit 2171a2e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: cores/esp8266/Updater.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,8 @@ bool UpdaterClass::end(bool evenIfRemaining){
282282
return false;
283283
}
284284
free(sig);
285+
_size = binSize; // Adjust size to remove signature, not part of bin payload
286+
285287
#ifdef DEBUG_UPDATER
286288
DEBUG_UPDATER.printf_P(PSTR("[Updater] Signature matches\n"));
287289
#endif

0 commit comments

Comments
 (0)