summaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_boottime.c
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2019-05-05 16:55:06 +0200
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2019-05-07 21:10:04 +0200
commit470dfa50da799720ed6513b89b9237064415cb73 (patch)
treedd2f0ab0db272966ca39af94586a3e6a3baae004 /lib/efi_loader/efi_boottime.c
parent84a918e8ce6cdc968a17e91768650bfe9eb8844a (diff)
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>
Diffstat (limited to 'lib/efi_loader/efi_boottime.c')
-rw-r--r--lib/efi_loader/efi_boottime.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index ef9e378189..89966a2f12 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -1781,6 +1781,10 @@ efi_status_t EFIAPI efi_load_image(bool boot_policy,
if (ret != EFI_SUCCESS)
goto error;
} else {
+ if (!source_size) {
+ ret = EFI_LOAD_ERROR;
+ goto error;
+ }
dest_buffer = source_buffer;
}
/* split file_path which contains both the device and file parts */