diff options
Diffstat (limited to 'source/components/resources/rscalc.c')
-rw-r--r-- | source/components/resources/rscalc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/components/resources/rscalc.c b/source/components/resources/rscalc.c index 6136fc6..5c373ec 100644 --- a/source/components/resources/rscalc.c +++ b/source/components/resources/rscalc.c @@ -230,6 +230,13 @@ AcpiRsGetAmlLength ( return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE); } + /* Sanity check the length. It must not be zero, or we loop forever */ + + if (!Resource->Length) + { + return_ACPI_STATUS (AE_AML_BAD_RESOURCE_LENGTH); + } + /* Get the base size of the (external stream) resource descriptor */ TotalSize = AcpiGbl_AmlResourceSizes [Resource->Type]; |