diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2019-05-10 19:21:41 +0200 |
---|---|---|
committer | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2019-05-12 20:54:22 +0200 |
commit | ab557141c2ddb9cccffa992651a240b63d5fbf5b (patch) | |
tree | 6b684193c9ee261990282e54035840632f799856 /lib | |
parent | 0a84319665e764ab1c9f619f43c01ef1627f4053 (diff) | |
download | u-boot-ab557141c2ddb9cccffa992651a240b63d5fbf5b.zip u-boot-ab557141c2ddb9cccffa992651a240b63d5fbf5b.tar.gz u-boot-ab557141c2ddb9cccffa992651a240b63d5fbf5b.tar.bz2 |
efi_loader: LocateDevicePath() incorrect parameter check
A parameter check in LocateDevicePath() does not match the requirements of
the UEFI spec.
If device is NULL, only return EFI_INVALID_PARAMETER if a matching handle
is found.
Cf. UEFI SCT II specification (2017)3.3.7 LocateDevicePath(), 5.1.3.7.3
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/efi_loader/efi_boottime.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index 887baaa..50c5374 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -2261,7 +2261,7 @@ static efi_status_t EFIAPI efi_locate_device_path( EFI_ENTRY("%pUl, %p, %p", protocol, device_path, device); - if (!protocol || !device_path || !*device_path || !device) { + if (!protocol || !device_path || !*device_path) { ret = EFI_INVALID_PARAMETER; goto out; } @@ -2294,6 +2294,10 @@ static efi_status_t EFIAPI efi_locate_device_path( /* Check if dp is a subpath of device_path */ if (memcmp(*device_path, dp, len_dp)) continue; + if (!device) { + ret = EFI_INVALID_PARAMETER; + goto out; + } *device = handles[i]; len_best = len_dp; } |