From 5eef6624f11cdb4c91d8f80237f118fcaf0dc159 Mon Sep 17 00:00:00 2001 From: SergeySlice Date: Sun, 26 Apr 2020 08:32:48 +0300 Subject: [PATCH] avoid infinite loop while kext patch Signed-off-by: SergeySlice --- rEFIt_UEFI/Platform/kext_patcher.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rEFIt_UEFI/Platform/kext_patcher.cpp b/rEFIt_UEFI/Platform/kext_patcher.cpp index 61e6b2f7e..cf3c93996 100644 --- a/rEFIt_UEFI/Platform/kext_patcher.cpp +++ b/rEFIt_UEFI/Platform/kext_patcher.cpp @@ -1010,6 +1010,10 @@ VOID AnyKextPatch(UINT8 *Driver, UINT32 DriverSize, CHAR8 *InfoPlist, UINT32 Inf j += Entry->KernelAndKextPatches->KextPatches[N].SearchLen - 1; } } + if (!Entry->KernelAndKextPatches->KextPatches[i].StartPattern || + !Entry->KernelAndKextPatches->KextPatches[i].StartPatternLen) { + break; + } j++; curs++; } } else {