OcAppleKernelLib: Avoid NULL 0-offset UB
@@ -54,6 +54,7 @@ InternalOcGetSymbolWorkerName (
//
Kext->Processed = TRUE;
+ if (Kext->LinkedSymbolTable != NULL) {
NumSymbols = Kext->NumberOfSymbols;
Symbols = Kext->LinkedSymbolTable;
@@ -84,6 +85,7 @@ InternalOcGetSymbolWorkerName (
}
Symbols++;
}
+ }
if (SymbolLevel != OcGetSymbolFirstLevel) {
for (Index = 0; Index < ARRAY_SIZE (Kext->Dependencies); ++Index) {
@@ -130,6 +132,7 @@ InternalOcGetSymbolWorkerValue (
//
Kext->Processed = TRUE;
+ if (Kext->LinkedSymbolTable != NULL) {
NumSymbols = Kext->NumberOfSymbols;
Symbols = Kext->LinkedSymbolTable;
@@ -152,6 +155,7 @@ InternalOcGetSymbolWorkerValue (
#undef MATCH
Symbols += 16;
}
+ }
if (SymbolLevel != OcGetSymbolFirstLevel) {
for (Index = 0; Index < ARRAY_SIZE (Kext->Dependencies); ++Index) {
