Skip to content

Commit

Permalink
OcBootManagementLib: Fix incorrect handling of optional DataLength pa…
Browse files Browse the repository at this point in the history
…rameter

Introduced by 546aa5b
  • Loading branch information
mikebeaton committed Oct 14, 2023
1 parent 16f83e5 commit 36b2cea
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ OpenCore Changelog
==================
#### v0.9.6
- Updated builtin firmware versions for SMBIOS and the rest
- Fixed hang while generating boot entries on some systems

#### v0.9.5
- Fixed GUID formatting for legacy NVRAM saving
Expand Down
4 changes: 2 additions & 2 deletions Include/Acidanthera/Library/OcBootManagementLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -2186,7 +2186,7 @@ OcGetBootEntryFileFromDevicePath (
IN UINT32 MaxFileSize,
IN UINT32 MinFileSize,
OUT VOID **FileData,
OUT UINT32 *DataLength,
OUT UINT32 *DataLength OPTIONAL,
IN BOOLEAN SearchAtLeaf,
IN BOOLEAN SearchAtRoot
);
Expand Down Expand Up @@ -2218,7 +2218,7 @@ OcGetBootEntryFile (
IN UINT32 MaxFileSize,
IN UINT32 MinFileSize,
OUT VOID **FileData,
OUT UINT32 *DataLength,
OUT UINT32 *DataLength OPTIONAL,
IN BOOLEAN SearchAtLeaf,
IN BOOLEAN SearchAtRoot
);
Expand Down
15 changes: 10 additions & 5 deletions Library/OcBootManagementLib/BootEntryInfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ OcGetBootEntryLabelImage (
OUT UINT32 *DataLength
)
{
ASSERT (DataLength != NULL);
return OcGetBootEntryFile (
BootEntry,
Scale == 2 ? L".disk_label_2x" : L".disk_label",
Expand All @@ -423,6 +424,7 @@ OcGetBootEntryIcon (
OUT UINT32 *DataLength
)
{
ASSERT (DataLength != NULL);
return OcGetBootEntryFile (
BootEntry,
L".VolumeIcon.icns",
Expand All @@ -446,7 +448,7 @@ InternalGetBootEntryFile (
IN UINT32 MaxFileSize,
IN UINT32 MinFileSize,
OUT VOID **FileData,
OUT UINT32 *DataLength,
OUT UINT32 *DataLength OPTIONAL,
IN BOOLEAN SearchAtLeaf,
IN BOOLEAN SearchAtRoot
)
Expand All @@ -458,9 +460,12 @@ InternalGetBootEntryFile (

ASSERT (SearchAtLeaf || SearchAtRoot);
ASSERT (DevicePath != NULL);
ASSERT (FileData != NULL);

*FileData = NULL;
*DataLength = 0;
*FileData = NULL;
if (DataLength != NULL) {
*DataLength = 0;
}

Status = OcBootPolicyDevicePathToDirPath (
DevicePath,
Expand Down Expand Up @@ -564,7 +569,7 @@ OcGetBootEntryFileFromDevicePath (
IN UINT32 MaxFileSize,
IN UINT32 MinFileSize,
OUT VOID **FileData,
OUT UINT32 *DataLength,
OUT UINT32 *DataLength OPTIONAL,
IN BOOLEAN SearchAtLeaf,
IN BOOLEAN SearchAtRoot
)
Expand Down Expand Up @@ -592,7 +597,7 @@ OcGetBootEntryFile (
IN UINT32 MaxFileSize,
IN UINT32 MinFileSize,
OUT VOID **FileData,
OUT UINT32 *DataLength,
OUT UINT32 *DataLength OPTIONAL,
IN BOOLEAN SearchAtLeaf,
IN BOOLEAN SearchAtRoot
)
Expand Down
1 change: 1 addition & 0 deletions Library/OcBootManagementLib/BootEntryManagement.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ ExpandShortFormBootPath (
/**
Check boot entry visibility by device path.
@param[in] Context Picker context.
@param[in] DevicePath Device path of the entry.
@return Entry visibility
Expand Down

0 comments on commit 36b2cea

Please sign in to comment.