Commit 3eaa2a19 authored by David Brown's avatar David Brown Committed by David Brown
Browse files

Rename misleading local variable

The local variable 'size' is actually the offset of the end, and not the
size.  Rename it to reflect this reality.

Signed-off-by: default avatarDavid Brown <david.brown@linaro.org>
parent 8dd56f3f
Loading
Loading
Loading
Loading
+3 −3
Changes for boot/bootutil/src/image_validate.c: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -144,7 +144,7 @@ bootutil_img_validate(struct image_header *hdr, const struct flash_area *fap,
                      uint8_t *seed, int seed_len, uint8_t *out_hash)
{
    uint32_t off;
    uint32_t size;
    uint32_t end;
    int sha256_valid = 0;
    struct image_tlv_info info;
#ifdef EXPECTED_SIG_TLV
@@ -177,14 +177,14 @@ bootutil_img_validate(struct image_header *hdr, const struct flash_area *fap,
    if (info.it_magic != IMAGE_TLV_INFO_MAGIC) {
            return -1;
    }
    size = off + info.it_tlv_tot;
    end = off + info.it_tlv_tot;
    off += sizeof(info);

    /*
     * Traverse through all of the TLVs, performing any checks we know
     * and are able to do.
     */
    for (; off < size; off += sizeof(tlv) + tlv.it_len) {
    for (; off < end; off += sizeof(tlv) + tlv.it_len) {
        rc = flash_area_read(fap, off, &tlv, sizeof tlv);
        if (rc) {
            return rc;