Skip to content

Commit bfc4162

Browse files
committed
SonarQube findings resolution
Access of 'unsigned char' element in 'buf' at an overflowing index Issue link: https://sonarcloud.io/project/issues?open=AZWum4_vvizSu0tgQ8Mw&id=nrfconnect_sdk-mcuboot Ref: NCSDK-35334 Signed-off-by: Adam Szczygieł <[email protected]>
1 parent 04c2e73 commit bfc4162

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

boot/boot_serial/src/boot_serial_encryption.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ decrypt_region_inplace(struct boot_loader_state *state,
182182
blk_sz = tlv_off - (off + bytes_copied);
183183
}
184184
}
185+
assert(idx < sz);
185186
boot_enc_decrypt(BOOT_CURR_ENC(state), slot,
186187
(off + bytes_copied + idx) - hdr->ih_hdr_size, blk_sz,
187188
blk_off, &buf[idx]);

0 commit comments

Comments
 (0)