From a7bbe458b21cea91ac04f068ea3450177df9182e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marvin=20H=C3=A4user?= <8659494+mhaeuser@users.noreply.github.com> Date: Fri, 2 Apr 2021 16:34:05 +0200 Subject: [PATCH] Do not halt on pointer/drive errors closes https://github.com/acidanthera/bugtracker/issues/1582 --- Library/OcFileLib/GetVolumeLabel.c | 6 +++--- Library/OcMainLib/OpenCoreUefiInOut.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Library/OcFileLib/GetVolumeLabel.c b/Library/OcFileLib/GetVolumeLabel.c index 105171f7..5987d766 100755 --- a/Library/OcFileLib/GetVolumeLabel.c +++ b/Library/OcFileLib/GetVolumeLabel.c @@ -77,9 +77,9 @@ GetVolumeLabel ( // terminating \0 (though they do append it). These drivers must // not be used, but we try not to die when debugging is off. // - if (VolumeInfo->VolumeLabel[VolumeLabelSize / sizeof (CHAR16) - 1] != '\0' - || VolumeLabelSize > OC_MAX_VOLUME_LABEL_SIZE * sizeof (CHAR16)) { - DEBUG ((DEBUG_ERROR, "OCFS: Found unterminated or too long volume label!")); + if (VolumeLabelSize > OC_MAX_VOLUME_LABEL_SIZE * sizeof (CHAR16) + || VolumeInfo->VolumeLabel[VolumeLabelSize / sizeof (CHAR16) - 1] != '\0') { + DEBUG ((DEBUG_INFO, "OCFS: Found unterminated or too long volume label!")); FreePool (VolumeInfo); return AllocateCopyPool (sizeof (L"INVALID"), L"INVALID"); } else { diff --git a/Library/OcMainLib/OpenCoreUefiInOut.c b/Library/OcMainLib/OpenCoreUefiInOut.c index 75bc28b7..71bba066 100644 --- a/Library/OcMainLib/OpenCoreUefiInOut.c +++ b/Library/OcMainLib/OpenCoreUefiInOut.c @@ -134,7 +134,7 @@ OcLoadUefiInputSupport ( if (PointerMode != OcInputPointerModeMax) { Status = OcAppleGenericInputPointerInit (PointerMode); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "OC: Failed to initialize pointer\n")); + DEBUG ((DEBUG_INFO, "OC: Failed to initialize pointer\n")); } else { ExitBs = TRUE; }