Commit 3f458fea authored by Antonio de Angelis's avatar Antonio de Angelis Committed by Dávid Vincze
Browse files

Bootutil: always initialise the size returned by boot_util_image_size()



Assert on the pointer validity in debug builds and make sure that
an initialised value of 0 is always returned even in case of errors

Change-Id: Ia0546941296fc9741c1b20955d7c7a0d47c7b2e1
Signed-off-by: default avatarAntonio de Angelis <Antonio.deAngelis@arm.com>
parent 671513cb
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -752,6 +752,9 @@ int boot_read_image_size(struct boot_loader_state *state, int slot, uint32_t *si

    fap = BOOT_IMG_AREA(state, slot);
    assert(fap != NULL);
    assert(size != NULL);

    *size = 0;

    off = BOOT_TLV_OFF(boot_img_hdr(state, slot));