DragonFlyBSD Kernel Audit
DF-1649 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/acpica/acpi_ec.c
+++ b/sys/dev/acpica/acpi_ec.c
@@ -815,7 +815,8 @@
 
     if (Function != ACPI_READ && Function != ACPI_WRITE)
 	return_ACPI_STATUS (AE_BAD_PARAMETER);
-    if (Width % 8 != 0 || Value == NULL || Context == NULL)
+    if (Width == 0 || Width > 64 || (Width & (Width - 1)) != 0 ||
+	Value == NULL || Context == NULL)
 	return_ACPI_STATUS (AE_BAD_PARAMETER);
     if (Address + Width / 8 > 256)
 	return_ACPI_STATUS (AE_BAD_ADDRESS);