Commit ecbea70b authored by Fabio Utzig's avatar Fabio Utzig Committed by Fabio Utzig
Browse files

Fix overflow in offset variable

In the TLV iterator code a variable is used to save the offset in flash
where the protected TLVs end; this was declared as uint16_t and could
easily overflow so fix it by updating the type to uint32_t.

Signed-off-by: default avatarFabio Utzig <utzig@apache.org>
parent f0131cd5
Loading
Loading
Loading
Loading
+1 −1
Changes for boot/bootutil/include/bootutil/image.h: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -151,7 +151,7 @@ struct image_tlv_iter {
    const struct flash_area *fap;
    uint8_t type;
    bool prot;
    uint16_t prot_end;
    uint32_t prot_end;
    uint32_t tlv_off;
    uint32_t tlv_end;
};