diff options
author | Krzysztof Koch <krzysztof.koch@arm.com> | 2020-01-20 19:13:42 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-02-11 02:12:45 +0000 |
commit | f69248d09351ea742667749c9bdeca35e94dd946 (patch) | |
tree | 80f4b91e19be3a4759e451957768d3fbe43eb8d2 /ShellPkg | |
parent | 5bd326c5f3fa987dec6b6fc85254f3fc7d6eceaf (diff) | |
download | edk2-f69248d09351ea742667749c9bdeca35e94dd946.zip edk2-f69248d09351ea742667749c9bdeca35e94dd946.tar.gz edk2-f69248d09351ea742667749c9bdeca35e94dd946.tar.bz2 |
ShellPkg: acpiview: RSDP: Validate global pointer before use
Check if XsdtAddress pointer has been successfully updated before it
is used for further table parsing.
Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
Diffstat (limited to 'ShellPkg')
-rw-r--r-- | ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c index 5a5c4b5..f4a8732 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c @@ -138,6 +138,18 @@ ParseAcpiRsdp ( PARSER_PARAMS (RsdpParser)
);
+ // Check if the values used to control the parsing logic have been
+ // successfully read.
+ if (XsdtAddress == NULL) {
+ IncrementErrorCount ();
+ Print (
+ L"ERROR: Insufficient table length. AcpiTableLength = %d." \
+ L"RSDP parsing aborted.\n",
+ AcpiTableLength
+ );
+ return;
+ }
+
// This code currently supports parsing of XSDT table only
// and does not parse the RSDT table. Platforms provide the
// RSDT to enable compatibility with ACPI 1.0 operating systems.
|