From 5d1901ac52a3031449a1ff31f990ae5e9a67d8c7 Mon Sep 17 00:00:00 2001 From: vit9696 Date: Wed, 27 Mar 2019 09:37:02 +0300 Subject: [PATCH] OcAppleKernelLib: Fix uninitialised data access caused by improper vtable construction --- Library/OcAppleKernelLib/Vtables.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Library/OcAppleKernelLib/Vtables.c b/Library/OcAppleKernelLib/Vtables.c index bda8aa37..c843c83b 100644 --- a/Library/OcAppleKernelLib/Vtables.c +++ b/Library/OcAppleKernelLib/Vtables.c @@ -469,9 +469,7 @@ InternalInitializeVtableByEntriesAndRelocations64 ( if (OcSymbol != NULL) { VtableEntries[Index].Name = OcSymbol->Name; VtableEntries[Index].Address = OcSymbol->Value; - } else { - VtableEntries[Index].Name = NULL; - VtableEntries[Index].Address = 0; + continue; } } else { if (SolveSymbolIndex >= NumSolveSymbols) { @@ -501,8 +499,12 @@ InternalInitializeVtableByEntriesAndRelocations64 ( VtableEntries[Index].Name = MachoGetSymbolName64 (MachoContext, Symbol); VtableEntries[Index].Address = Symbol->Value; + continue; } } + + VtableEntries[Index].Name = NULL; + VtableEntries[Index].Address = 0; } Vtable->Name = VtableName;