mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-27 15:10:26 +09:00
efi_loader: LoadImage() check source size
If the size of the source buffer is 0, return EFI_LOAD_ERROR. (UEFI SCT II 2017: 3.4.1 LoadImage() - 5.1.4.1.6) Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
parent
84a918e8ce
commit
470dfa50da
@ -1781,6 +1781,10 @@ efi_status_t EFIAPI efi_load_image(bool boot_policy,
|
|||||||
if (ret != EFI_SUCCESS)
|
if (ret != EFI_SUCCESS)
|
||||||
goto error;
|
goto error;
|
||||||
} else {
|
} else {
|
||||||
|
if (!source_size) {
|
||||||
|
ret = EFI_LOAD_ERROR;
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
dest_buffer = source_buffer;
|
dest_buffer = source_buffer;
|
||||||
}
|
}
|
||||||
/* split file_path which contains both the device and file parts */
|
/* split file_path which contains both the device and file parts */
|
||||||
|
Loading…
Reference in New Issue
Block a user