From 32bf4191362f933a54fb62314bda2bc73d936d65 Mon Sep 17 00:00:00 2001 From: vit9696 Date: Sat, 18 Jul 2020 04:40:37 +0300 Subject: [PATCH] OcAppleKernelLib: Fix memory corruption with many kexts in 11.0 --- Library/OcAppleKernelLib/KernelCollection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/OcAppleKernelLib/KernelCollection.c b/Library/OcAppleKernelLib/KernelCollection.c index f3340bbc..8eae4fac 100644 --- a/Library/OcAppleKernelLib/KernelCollection.c +++ b/Library/OcAppleKernelLib/KernelCollection.c @@ -201,7 +201,7 @@ KcRebuildMachHeader ( CurrentSize = MachHeader->CommandsSize + sizeof (*MachHeader); FilesetSize = InternalKcGetKextFilesetSize (Context); - RequiredSize = FilesetSize + sizeof (MACH_LOAD_COMMAND_SEGMENT_64) + Context->PrelinkedInfoSegment->CommandSize; + RequiredSize = FilesetSize + sizeof (MACH_SEGMENT_COMMAND_64) + Context->PrelinkedInfoSegment->CommandSize; TextSegment = MachoGetSegmentByName64 ( &Context->PrelinkedMachContext,