提交 1d76ae69 编写于 作者: V vit9696

OcVirtualFsLib: Fix handling buggy programs passing NULL to FileOpen

上级 c46fe4f1
......@@ -23,6 +23,7 @@ OpenCore Changelog
- Fixed `i386-user32` being incorrectly enabled in macOS 10.4, 10.5, and 10.7
- Disabled prelinked boot for macOS 10.4 and 10.5 in `KernelCache` `Auto` mode
- Fixed `macserial` compatibility with iMac20,x serials and other models from 2020
- Added `LegacyCommpage` quirk to improve pre-SSSE3 userspace compatibility
#### v0.6.1
- Improved recognition of early pressed hotkeys, thx @varahash
......
......@@ -443,14 +443,14 @@
<dict>
<key>DummyPowerManagement</key>
<false/>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string></string>
<key>Cpuid1Data</key>
<data></data>
<key>Cpuid1Mask</key>
<data></data>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string></string>
</dict>
<key>Force</key>
<array>
......@@ -684,6 +684,8 @@
<false/>
<key>LapicKernelPanic</key>
<false/>
<key>LegacyCommpage</key>
<false/>
<key>PanicNoKextDump</key>
<false/>
<key>PowerTimeoutKernelPanic</key>
......
......@@ -443,14 +443,14 @@
<dict>
<key>DummyPowerManagement</key>
<false/>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string></string>
<key>Cpuid1Data</key>
<data></data>
<key>Cpuid1Mask</key>
<data></data>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string></string>
</dict>
<key>Force</key>
<array>
......@@ -684,6 +684,8 @@
<false/>
<key>LapicKernelPanic</key>
<false/>
<key>LegacyCommpage</key>
<false/>
<key>PanicNoKextDump</key>
<false/>
<key>PowerTimeoutKernelPanic</key>
......
......@@ -251,6 +251,9 @@ SetFileData (
EFI_FILE_PROTOCOL *File;
UINTN WrittenSize;
ASSERT (FileName != NULL);
ASSERT (Buffer != NULL);
if (WritableFs == NULL) {
Status = FindWritableFileSystem (&Fs);
if (EFI_ERROR (Status)) {
......
......@@ -163,6 +163,9 @@ ReadFileFromFile (
UINT32 Size;
UINT8 *FileBuffer;
ASSERT (RootFile != NULL);
ASSERT (FilePath != NULL);
Status = SafeFileOpen (
RootFile,
&File,
......
......@@ -226,6 +226,10 @@ OcStorageInitFromFs (
UINT32 DataSize;
UINT32 SignatureSize;
ASSERT (Context != NULL);
ASSERT (FileSystem != NULL);
ASSERT (Path != NULL);
ZeroMem (Context, sizeof (*Context));
Context->FileSystem = FileSystem;
......
......@@ -42,7 +42,7 @@ VirtualDirOpen (
EFI_STATUS Status;
VIRTUAL_DIR_DATA *Data;
if (This == NULL) {
if (This == NULL || NewHandle == NULL || FileName == NULL) {
return EFI_INVALID_PARAMETER;
}
......
......@@ -42,7 +42,7 @@ VirtualFileOpen (
EFI_STATUS Status;
VIRTUAL_FILE_DATA *Data;
if (This == NULL) {
if (This == NULL || NewHandle == NULL || FileName == NULL) {
return EFI_INVALID_PARAMETER;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册