summaryrefslogtreecommitdiff
path: root/source/components/resources/rscalc.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2013-02-15 19:12:35 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2013-02-15 19:12:35 +0000
commit6bb10c5e2fa82c104e57c7468335930ba9e47d4f (patch)
tree60bd49061ad572a9f0cd0955d91e302983ee6939 /source/components/resources/rscalc.c
parenta8e5af903d1868804e09dfa39195b9bb1826ace2 (diff)
Notes
Diffstat (limited to 'source/components/resources/rscalc.c')
-rw-r--r--source/components/resources/rscalc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/components/resources/rscalc.c b/source/components/resources/rscalc.c
index 6136fc671b00..5c373ec9cde1 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];