Skip to content

Commit

Permalink
flash: trigger failloop if we fail to parse target
Browse files Browse the repository at this point in the history
  • Loading branch information
bkleiner committed Dec 11, 2024
1 parent 6ed571d commit 0cd655a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,11 @@ void flash_load() {

cbor_value_t dec;
cbor_decoder_init(&dec, buffer, size);
cbor_decode_target_t(&dec, &target);

cbor_result_t res = cbor_decode_target_t(&dec, &target);
if (res < CBOR_OK) {
failloop(FAILLOOP_FAULT);
}
}

if (flash_compare_magic(FLASH_STORAGE_OFFSET, (FMC_MAGIC | FLASH_STORAGE_OFFSET))) {
Expand Down

0 comments on commit 0cd655a

Please sign in to comment.