OcAppleKernelLib: Fix uninitialised data access caused by improper vtable construction

This commit is contained in:
vit9696 2019-03-27 09:37:02 +03:00
parent cc254d2ae3
commit 5d1901ac52

View File

@ -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;