Platform: Fix for flash_otp_nv_counters_write out-of-bound stack access
When TFM_HAL_ITS_PROGRAM_UNIT is 1, the swap_count_buf is just 1 byte
so it shouldn't be treated using 32-bit pointers as that would likely
result in out-of-bound access on the function stack. Make sure that
the swap_count_buf is always at least 4 bytes, i.e. the biggest value
between 4 and TFM_HAL_ITS_PROGRAM_UNIT so that the counter can always
be treated as a 4-byte variable.
Signed-off-by: Antonio de Angelis <antonio.deangelis@arm.com>
Change-Id: I8022a908fddce4332123b6963e0aad09c62f0ef4
1 file changed