Blame SOURCES/DSDT-too-long.patch
|
|
fa2344 |
ASL Test Suite encounters the following type of error...
|
|
|
fa2344 |
|
|
|
fa2344 |
Table [DSDT] is too long for file - needs: 0xCE4C0000, remaining in file: 0x4CCE
|
|
|
fa2344 |
|
|
|
fa2344 |
when tests/aslts.sh was run on a big-endian system.
|
|
|
fa2344 |
|
|
|
fa2344 |
diff --git a/source/common/acfileio.c b/source/common/acfileio.c
|
|
|
fa2344 |
index 589eaea..83e59e2 100644
|
|
|
fa2344 |
--- a/source/common/acfileio.c
|
|
|
fa2344 |
+++ b/source/common/acfileio.c
|
|
|
fa2344 |
@@ -391,6 +391,7 @@ AcValidateTableHeader (
|
|
|
fa2344 |
size_t Actual;
|
|
|
fa2344 |
long OriginalOffset;
|
|
|
fa2344 |
UINT32 FileSize;
|
|
|
fa2344 |
+ UINT32 Length;
|
|
|
fa2344 |
UINT32 i;
|
|
|
fa2344 |
|
|
|
fa2344 |
|
|
|
fa2344 |
@@ -422,11 +423,12 @@ AcValidateTableHeader (
|
|
|
fa2344 |
/* Validate table length against bytes remaining in the file */
|
|
|
fa2344 |
|
|
|
fa2344 |
FileSize = CmGetFileSize (File);
|
|
|
fa2344 |
- if (TableHeader.Length > (UINT32) (FileSize - TableOffset))
|
|
|
fa2344 |
+ ACPI_MOVE_32_TO_32(&Length, &TableHeader.Length);
|
|
|
fa2344 |
+ if (Length > (UINT32) (FileSize - TableOffset))
|
|
|
fa2344 |
{
|
|
|
fa2344 |
fprintf (stderr, "Table [%4.4s] is too long for file - "
|
|
|
fa2344 |
"needs: 0x%.2X, remaining in file: 0x%.2X\n",
|
|
|
fa2344 |
- TableHeader.Signature, TableHeader.Length,
|
|
|
fa2344 |
+ TableHeader.Signature, Length,
|
|
|
fa2344 |
(UINT32) (FileSize - TableOffset));
|
|
|
fa2344 |
return (AE_BAD_HEADER);
|
|
|
fa2344 |
}
|