Skip to content

Commit 0319e91

Browse files
Stephane-LeRoynvlsianpu
authored andcommitted
boot: bootutil: Fix encryption/decryption size during copy
During region copy, when chunk contains both header and TLVs, the encryption/decryption size is too large, as it takes into account TLVs only. The fix modifies the encryption/decryption size to take into account both header and TLVs. Signed-off-by: Stephane Le Roy <[email protected]>
1 parent a36f951 commit 0319e91

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

boot/bootutil/src/loader.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1534,7 +1534,7 @@ boot_copy_region(struct boot_loader_state *state,
15341534
if (abs_off >= tlv_off) {
15351535
blk_sz = 0;
15361536
} else {
1537-
blk_sz = tlv_off - abs_off;
1537+
blk_sz = tlv_off - abs_off - idx;
15381538
}
15391539
}
15401540
if (source_slot == 0) {

0 commit comments

Comments
 (0)