mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-29 02:21:31 +00:00
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>
This commit is contained in:
parent
0a84319665
commit
ab557141c2
1 changed files with 5 additions and 1 deletions
|
@ -2261,7 +2261,7 @@ static efi_status_t EFIAPI efi_locate_device_path(
|
||||||
|
|
||||||
EFI_ENTRY("%pUl, %p, %p", protocol, device_path, device);
|
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;
|
ret = EFI_INVALID_PARAMETER;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -2294,6 +2294,10 @@ static efi_status_t EFIAPI efi_locate_device_path(
|
||||||
/* Check if dp is a subpath of device_path */
|
/* Check if dp is a subpath of device_path */
|
||||||
if (memcmp(*device_path, dp, len_dp))
|
if (memcmp(*device_path, dp, len_dp))
|
||||||
continue;
|
continue;
|
||||||
|
if (!device) {
|
||||||
|
ret = EFI_INVALID_PARAMETER;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
*device = handles[i];
|
*device = handles[i];
|
||||||
len_best = len_dp;
|
len_best = len_dp;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue