OcAppleKernelLib: Verify indirect symbol pointer alignments.
@@ -1152,8 +1152,15 @@ InternalProcessSymbolPointers (
// action is required.
//
SymIndex = (UINT32 *)((UINTN)MachHeader + DySymtab->IndirectSymbolsOffset);
+ if (!OC_ALIGNED (SymIndex)) {
+ return FALSE;
+ }
SymIndex += FirstSym;
+
SymPtr = (CHAR8 *)((UINTN)MachHeader + Section->Offset);
+ if (!OC_ALIGNED ((UINT64 *)SymPtr)) {
+ return FALSE;
+ }
for (Index = 0; Index < NumSymbols; ++Index, SymPtr += sizeof (MACH_NLIST_64)) {
if ((*SymIndex & MACH_INDIRECT_SYMBOL_LOCAL) != 0) {
