Skip to content

Commit 2239c6e

Browse files
committed
Added bound check to get_decrypted_blob_version
F/374
1 parent ae1e9df commit 2239c6e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/update_disk.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ static uint32_t get_decrypted_blob_version(uint8_t *hdr)
134134
continue;
135135
}
136136

137+
if (p + 4 + tlv_len > max_p)
138+
break;
139+
137140
if (tlv_type == HDR_VERSION && tlv_len == 4) {
138141
uint32_t ver = *((uint32_t*)(p + 4));
139142
return ver;

0 commit comments

Comments
 (0)