mirror of
https://github.com/acidanthera/OpenCorePkg.git
synced 2025-12-08 19:25:01 +00:00
OcBootManagementLib: Fix potential OOB access
This commit is contained in:
parent
10ff0faa63
commit
d20dd35105
@ -291,6 +291,7 @@ InternalSetBootEntryFlags (
|
||||
{
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePathWalker;
|
||||
CONST CHAR16 *Path;
|
||||
UINTN Len;
|
||||
|
||||
BootEntry->IsFolder = FALSE;
|
||||
BootEntry->IsRecovery = FALSE;
|
||||
@ -306,7 +307,8 @@ InternalSetBootEntryFlags (
|
||||
if ((DevicePathType (DevicePathWalker) == MEDIA_DEVICE_PATH)
|
||||
&& (DevicePathSubType (DevicePathWalker) == MEDIA_FILEPATH_DP)) {
|
||||
Path = ((FILEPATH_DEVICE_PATH *) DevicePathWalker)->PathName;
|
||||
if (Path[StrLen (Path) - 1] == L'\\') {
|
||||
Len = StrLen (Path);
|
||||
if ((Len > 0) && (Path[Len - 1] == L'\\')) {
|
||||
BootEntry->IsFolder = TRUE;
|
||||
}
|
||||
if (StrStr (Path, L"com.apple.recovery.boot") != NULL) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user