Skip to content
Snippets Groups Projects
Commit a7126edc authored by Niko Mauno's avatar Niko Mauno Committed by Anatolij Gustschin
Browse files

splash_source: Verify FIT magic


Before reading entire FIT image, add sanity check by testing image
header against FDT_MAGIC. This should help avoid problems in situations
where FIT is not yet available from storage device, for example when
performing initial programming of device.

Cc: Anatolij Gustschin <agust@denx.de>
Acked-by: default avatarTomas Melin <tomas.melin@vaisala.com>
parent f8ba7f27
No related branches found
No related tags found
No related merge requests found
...@@ -317,6 +317,11 @@ static int splash_load_fit(struct splash_location *location, u32 bmp_load_addr) ...@@ -317,6 +317,11 @@ static int splash_load_fit(struct splash_location *location, u32 bmp_load_addr)
return res; return res;
img_header = (struct image_header *)bmp_load_addr; img_header = (struct image_header *)bmp_load_addr;
if (image_get_magic(img_header) != FDT_MAGIC) {
printf("Could not find FDT magic\n");
return -EINVAL;
}
fit_size = fdt_totalsize(img_header); fit_size = fdt_totalsize(img_header);
/* Read in entire FIT */ /* Read in entire FIT */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment