]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c
ShellPkg: acpiview: RSDP: Validate global pointer before use
[mirror_edk2.git] / ShellPkg / Library / UefiShellAcpiViewCommandLib / Parsers / Rsdp / RsdpParser.c
index 5a5c4b50c12e6eb0aa0efb1765df7e123f614da3..f4a8732a7db7c437031f2a3d2f266b80eff17b4b 100644 (file)
@@ -138,6 +138,18 @@ ParseAcpiRsdp (
     PARSER_PARAMS (RsdpParser)\r
     );\r
 \r
+  // Check if the values used to control the parsing logic have been\r
+  // successfully read.\r
+  if (XsdtAddress == NULL) {\r
+    IncrementErrorCount ();\r
+    Print (\r
+      L"ERROR: Insufficient table length. AcpiTableLength = %d." \\r
+        L"RSDP parsing aborted.\n",\r
+      AcpiTableLength\r
+      );\r
+    return;\r
+  }\r
+\r
   // This code currently supports parsing of XSDT table only\r
   // and does not parse the RSDT table. Platforms provide the\r
   // RSDT to enable compatibility with ACPI 1.0 operating systems.\r