mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2025-08-03 20:24:20 -04:00
fw: Check flash app length to be within limits
Complain if the pre-loaded app on flash is larger than app RAM. Co-authored-by: Mikael Ågren <mikael@tillitis.se>
This commit is contained in:
parent
49d5a26a77
commit
106a7a5613
1 changed files with 3 additions and 2 deletions
|
@ -29,8 +29,9 @@ int preload_load(struct partition_table *part_table, uint8_t from_slot)
|
|||
return -4;
|
||||
}
|
||||
|
||||
/*Check for a valid app in flash */
|
||||
if (part_table->pre_app_data[from_slot].size == 0) {
|
||||
/* Check for a valid app in flash */
|
||||
if (part_table->pre_app_data[from_slot].size == 0 &&
|
||||
part_table->pre_app_data[from_slot].size <= TK1_APP_MAX_SIZE) {
|
||||
return -1;
|
||||
}
|
||||
uint8_t *loadaddr = (uint8_t *)TK1_RAM_BASE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue