/** @file\r
SRAT table parser\r
\r
- Copyright (c) 2016 - 2019, ARM Limited. All rights reserved.\r
+ Copyright (c) 2016 - 2020, ARM Limited. All rights reserved.\r
SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
@par Reference(s):\r
return;\r
}\r
\r
- // Make sure the SRAT structure lies inside the table\r
- if ((Offset + *SratRALength) > AcpiTableLength) {\r
+ // Validate Static Resource Allocation Structure length\r
+ if ((*SratRALength == 0) ||\r
+ ((Offset + (*SratRALength)) > AcpiTableLength)) {\r
IncrementErrorCount ();\r
Print (\r
- L"ERROR: Invalid SRAT structure length. SratRALength = %d. " \\r
- L"RemainingTableBufferLength = %d. SRAT parsing aborted.\n",\r
+ L"ERROR: Invalid Static Resource Allocation Structure length. " \\r
+ L"Length = %d. Offset = %d. AcpiTableLength = %d.\n",\r
*SratRALength,\r
- AcpiTableLength - Offset\r
+ Offset,\r
+ AcpiTableLength\r
);\r
return;\r
}\r