[SeaBIOS] [PATCH v2 3/6] acpi_extract: fix off-by-one

Paolo Bonzini pbonzini at redhat.com
Thu Aug 2 15:07:23 CEST 2012


Single-byte package length values do use bits 4-5, and this will
happen with the PCI hotplug devices.  pkglenbytes has not yet been
decremented, so multi-byte values are detected with pkglenbytes > 1.

Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
---
 tools/acpi_extract.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/acpi_extract.py b/tools/acpi_extract.py
index 167a322..81fa4aa 100755
--- a/tools/acpi_extract.py
+++ b/tools/acpi_extract.py
@@ -93,7 +93,7 @@ def aml_pkglen(offset):
     pkglenbytes = aml_pkglen_bytes(offset)
     pkglen = aml[offset] & 0x3F
     # If multibyte, first nibble only uses bits 0-3
-    if ((pkglenbytes > 0) and (pkglen & 0x30)):
+    if ((pkglenbytes > 1) and (pkglen & 0x30)):
         die("PkgLen bytes 0x%x but first nibble 0x%x expected 0x0X" %
             (pkglen, pkglen))
     offset += 1
-- 
1.7.10.4





More information about the SeaBIOS mailing list