Skip to content

Commit 567f2b0

Browse files
committed
[nrf noup] boot: zephyr: decompression: Fix stray sizeof() usage
fixup! [nrf noup] zephyr: Add support for compressed image updates Fixes an issue with using sizeof() for variables for buffer sizes instead of the actual buffer size itself Signed-off-by: Jamie McCrae <[email protected]> (cherry picked from commit 6ef9e63)
1 parent c9e4436 commit 567f2b0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

boot/zephyr/decompression.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,7 +1177,7 @@ int boot_copy_region_decompress(struct boot_loader_state *state, const struct fl
11771177
if (protected_tlv_size > 0) {
11781178
rc = boot_copy_protected_tlvs(hdr, fap_src, fap_dst, (off_dst + hdr->ih_hdr_size +
11791179
write_pos), protected_tlv_size,
1180-
decomp_buf, sizeof(decomp_buf_size), &decomp_buf_size,
1180+
decomp_buf, decomp_buf_size, &decomp_buf_size,
11811181
&tlv_write_size);
11821182

11831183
if (rc) {
@@ -1191,7 +1191,7 @@ int boot_copy_region_decompress(struct boot_loader_state *state, const struct fl
11911191
tlv_write_size = 0;
11921192
rc = boot_copy_unprotected_tlvs(hdr, fap_src, fap_dst, (off_dst + hdr->ih_hdr_size +
11931193
write_pos), unprotected_tlv_size,
1194-
decomp_buf, sizeof(decomp_buf_size), &decomp_buf_size,
1194+
decomp_buf, decomp_buf_size, &decomp_buf_size,
11951195
&tlv_write_size);
11961196

11971197
if (rc) {
@@ -1219,7 +1219,7 @@ int boot_copy_region_decompress(struct boot_loader_state *state, const struct fl
12191219

12201220
if (rc != 0) {
12211221
BOOT_LOG_ERR("Flash write failed at offset: 0x%x, size: 0x%x, area: %d, rc: %d",
1222-
(off_dst + hdr->ih_hdr_size + write_pos), sizeof(decomp_buf_size),
1222+
(off_dst + hdr->ih_hdr_size + write_pos), decomp_buf_size,
12231223
fap_dst->fa_id, rc);
12241224
rc = BOOT_EFLASH;
12251225
goto finish;

0 commit comments

Comments
 (0)