fix: Fix-Runde 2 für Task 4 - Ablehnung sofort statt nach voller Resume-Schleife, Reset-Guard auch bei OOM greifen lassen

This commit is contained in:
Michael Sauer
2026-09-12 02:04:58 +02:00
parent 37c05d2f90
commit 2d5095574d
3 changed files with 36 additions and 1 deletions
+8
View File
@@ -418,6 +418,14 @@ static void fwup_scheduler(void *data)
RSA_SHA256 = tls_mem_alloc(left);
if(!RSA_SHA256)
{
/* ninlight: this used to jump to request_finish without setting any
* error bit. With the C1 fix (see below / sdk/PATCHES.md point 1) the
* request_finish reset only fires when no error bit is set - so this
* was the one remaining way to reach a reset with the trailer never
* actually checked. Report it like the other allocation failure above. */
request->status = TLS_FWUP_REQ_STATUS_FMEM;
fwup->current_state |= TLS_FWUP_STATE_ERROR_MEM;
nl_ota_set_error("download"); /* no more specific value applies */
goto request_finish;
}
while (left > 0)