Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
ba97238d
O
OpenCorePKG_MOD
项目概览
btwise
/
OpenCorePKG_MOD
通知
26
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
OpenCorePKG_MOD
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ba97238d
编写于
3月 14, 2020
作者:
V
vit9696
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OpenCore: Validate storage path lengths
上级
1c2d05c0
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
77 addition
and
10 deletion
+77
-10
Platform/OpenCore/OpenCoreAcpi.c
Platform/OpenCore/OpenCoreAcpi.c
+11
-1
Platform/OpenCore/OpenCoreKernel.c
Platform/OpenCore/OpenCoreKernel.c
+35
-3
Platform/OpenCore/OpenCoreMisc.c
Platform/OpenCore/OpenCoreMisc.c
+12
-1
Platform/OpenCore/OpenCoreUefi.c
Platform/OpenCore/OpenCoreUefi.c
+10
-1
Platform/OpenCore/OpenCoreUefiAudio.c
Platform/OpenCore/OpenCoreUefiAudio.c
+9
-4
未找到文件。
Platform/OpenCore/OpenCoreAcpi.c
浏览文件 @
ba97238d
...
...
@@ -48,7 +48,17 @@ OcAcpiAddTables (
continue
;
}
UnicodeSPrint
(
FullPath
,
sizeof
(
FullPath
),
OPEN_CORE_ACPI_PATH
"%a"
,
TablePath
);
Status
=
OcUnicodeSafeSPrint
(
FullPath
,
sizeof
(
FullPath
),
OPEN_CORE_ACPI_PATH
"%a"
,
TablePath
);
if
(
EFI_ERROR
(
Status
))
{
DEBUG
((
DEBUG_WARN
,
"OC: Failed to fit ACPI path %s%a"
,
OPEN_CORE_ACPI_PATH
,
TablePath
));
continue
;
}
UnicodeUefiSlashes
(
FullPath
);
TableData
=
OcStorageReadFileUnicode
(
Storage
,
FullPath
,
&
TableDataLength
);
...
...
Platform/OpenCore/OpenCoreKernel.c
浏览文件 @
ba97238d
...
...
@@ -174,6 +174,7 @@ OcKernelLoadKextsAndReserve (
IN
OC_GLOBAL_CONFIG
*
Config
)
{
EFI_STATUS
Status
;
UINT32
Index
;
UINT32
ReserveSize
;
CHAR8
*
BundlePath
;
...
...
@@ -202,13 +203,24 @@ OcKernelLoadKextsAndReserve (
continue
;
}
Unicod
eSPrint
(
Status
=
OcUnicodeSaf
eSPrint
(
FullPath
,
sizeof
(
FullPath
),
OPEN_CORE_KEXT_PATH
"%a
\\
%a"
,
BundlePath
,
PlistPath
);
if
(
EFI_ERROR
(
Status
))
{
DEBUG
((
DEBUG_WARN
,
"OC: Failed to fit kext path %s%a
\\
%a"
,
OPEN_CORE_KEXT_PATH
,
BundlePath
,
PlistPath
));
Kext
->
Enabled
=
FALSE
;
continue
;
}
UnicodeUefiSlashes
(
FullPath
);
...
...
@@ -232,13 +244,26 @@ OcKernelLoadKextsAndReserve (
ExecutablePath
=
OC_BLOB_GET
(
&
Kext
->
ExecutablePath
);
if
(
ExecutablePath
[
0
]
!=
'\0'
)
{
Unicod
eSPrint
(
Status
=
OcUnicodeSaf
eSPrint
(
FullPath
,
sizeof
(
FullPath
),
OPEN_CORE_KEXT_PATH
"%a
\\
%a"
,
BundlePath
,
ExecutablePath
);
if
(
EFI_ERROR
(
Status
))
{
DEBUG
((
DEBUG_WARN
,
"OC: Failed to fit kext path %s%a
\\
%a"
,
OPEN_CORE_KEXT_PATH
,
BundlePath
,
ExecutablePath
));
Kext
->
Enabled
=
FALSE
;
FreePool
(
Kext
->
PlistData
);
Kext
->
PlistData
=
NULL
;
continue
;
}
UnicodeUefiSlashes
(
FullPath
);
...
...
@@ -257,6 +282,8 @@ OcKernelLoadKextsAndReserve (
Comment
));
Kext
->
Enabled
=
FALSE
;
FreePool
(
Kext
->
PlistData
);
Kext
->
PlistData
=
NULL
;
continue
;
}
}
...
...
@@ -603,7 +630,12 @@ OcKernelProcessPrelinked (
continue
;
}
AsciiSPrint
(
FullPath
,
sizeof
(
FullPath
),
"/Library/Extensions/%a"
,
BundlePath
);
Status
=
OcAsciiSafeSPrint
(
FullPath
,
sizeof
(
FullPath
),
"/Library/Extensions/%a"
,
BundlePath
);
if
(
EFI_ERROR
(
Status
))
{
DEBUG
((
DEBUG_WARN
,
"OC: Failed to fit kext path /Library/Extensions/%a"
,
BundlePath
));
continue
;
}
if
(
Kext
->
ImageData
!=
NULL
)
{
ExecutablePath
=
OC_BLOB_GET
(
&
Kext
->
ExecutablePath
);
}
else
{
...
...
Platform/OpenCore/OpenCoreMisc.c
浏览文件 @
ba97238d
...
...
@@ -23,6 +23,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/OcAppleBootPolicyLib.h>
#include <Library/OcConsoleLib.h>
#include <Library/OcDebugLogLib.h>
#include <Library/OcStringLib.h>
#include <Library/PrintLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
...
...
@@ -84,15 +85,25 @@ OcToolLoadEntry (
OUT
EFI_DEVICE_PATH_PROTOCOL
**
ParentFilePath
OPTIONAL
)
{
EFI_STATUS
Status
;
CHAR16
ToolPath
[
OC_STORAGE_SAFE_PATH_MAX
];
OC_STORAGE_CONTEXT
*
Storage
;
Unicod
eSPrint
(
Status
=
OcUnicodeSaf
eSPrint
(
ToolPath
,
sizeof
(
ToolPath
),
OPEN_CORE_TOOL_PATH
"%s"
,
ChosenEntry
->
PathName
);
if
(
EFI_ERROR
(
Status
))
{
DEBUG
((
DEBUG_ERROR
,
"OC: Tool %s%s does not fit path!
\n
"
,
OPEN_CORE_TOOL_PATH
,
ToolPath
));
return
EFI_NOT_FOUND
;
}
Storage
=
(
OC_STORAGE_CONTEXT
*
)
Context
;
...
...
Platform/OpenCore/OpenCoreUefi.c
浏览文件 @
ba97238d
...
...
@@ -109,12 +109,21 @@ OcLoadDrivers (
continue
;
}
Unicod
eSPrint
(
Status
=
OcUnicodeSaf
eSPrint
(
DriverPath
,
sizeof
(
DriverPath
),
OPEN_CORE_UEFI_DRIVER_PATH
"%a"
,
OC_BLOB_GET
(
Config
->
Uefi
.
Drivers
.
Values
[
Index
])
);
if
(
EFI_ERROR
(
Status
))
{
DEBUG
((
DEBUG_ERROR
,
"OC: Driver %s%a doex not fit path!
\n
"
,
OPEN_CORE_UEFI_DRIVER_PATH
,
OC_BLOB_GET
(
Config
->
Uefi
.
Drivers
.
Values
[
Index
])
));
continue
;
}
Driver
=
OcStorageReadFileUnicode
(
Storage
,
DriverPath
,
&
DriverSize
);
if
(
Driver
==
NULL
)
{
...
...
Platform/OpenCore/OpenCoreUefiAudio.c
浏览文件 @
ba97238d
...
...
@@ -70,6 +70,7 @@ OcAudioAcquireFile (
OUT
UINT32
*
BufferSize
)
{
EFI_STATUS
Status
;
CHAR8
IndexPath
[
8
];
CHAR16
FilePath
[
OC_STORAGE_SAFE_PATH_MAX
];
OC_STORAGE_CONTEXT
*
Storage
;
...
...
@@ -94,13 +95,14 @@ OcAudioAcquireFile (
BaseType
=
"OCEFIAudio"
;
if
(
File
>
OcVoiceOverAudioFileIndexBase
&&
File
<=
OcVoiceOverAudioFileIndexMax
)
{
Ascii
SPrint
(
Status
=
OcAsciiSafe
SPrint
(
IndexPath
,
sizeof
(
IndexPath
),
"%a%c"
,
File
>=
OcVoiceOverAudioFileIndexAlphabetical
?
"Letter"
:
""
,
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
[
File
-
OcVoiceOverAudioFileIndexBase
]
);
ASSERT_EFI_ERROR
(
Status
);
BasePath
=
IndexPath
;
}
else
{
switch
(
File
)
{
...
...
@@ -251,7 +253,7 @@ OcAudioAcquireFile (
}
if
(
Localised
)
{
Unicod
eSPrint
(
Status
=
OcUnicodeSaf
eSPrint
(
FilePath
,
sizeof
(
FilePath
),
OPEN_CORE_AUDIO_PATH
"%a_%a_%a.wav"
,
...
...
@@ -259,9 +261,10 @@ OcAudioAcquireFile (
OcLanguageCodeToString
(
LanguageCode
),
BasePath
);
ASSERT_EFI_ERROR
(
Status
);
if
(
!
OcStorageExistsFileUnicode
(
Context
,
FilePath
))
{
Unicod
eSPrint
(
Status
=
OcUnicodeSaf
eSPrint
(
FilePath
,
sizeof
(
FilePath
),
OPEN_CORE_AUDIO_PATH
"%a_%a_%a.wav"
,
...
...
@@ -269,15 +272,17 @@ OcAudioAcquireFile (
OcLanguageCodeToString
(
AppleVoiceOverLanguageEn
),
BasePath
);
ASSERT_EFI_ERROR
(
Status
);
}
}
else
{
Unicod
eSPrint
(
Status
=
OcUnicodeSaf
eSPrint
(
FilePath
,
sizeof
(
FilePath
),
OPEN_CORE_AUDIO_PATH
"%a_%a.wav"
,
BaseType
,
BasePath
);
ASSERT_EFI_ERROR
(
Status
);
}
DEBUG
((
DEBUG_INFO
,
"OC: Wave %s was requested
\n
"
,
FilePath
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录