Skip to contentSkip to conversation

sbshc: acpi_device_class "smbus_host_controller" too long

PATCH New Dan Carpenter 1 participant 1 message Mar 19, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sbshc: acpi_device_class "smbus_host_controller" too long

acpi_device_class can only be 19 characters and a NULL terminator.

With the current name we get a buffer overflow in acpi_smbus_hc_add() when we do:

	strcpy(acpi_device_class(device), ACPI_SMB_HC_CLASS);
drivers/acpi/sbshc.c +1 -1
index fd09229..1fbf073 100644
@@ -17,7 +17,7 @@
 
 #define PREFIX "ACPI: "
 
-#define ACPI_SMB_HC_CLASS	"smbus_host_controller"
+#define ACPI_SMB_HC_CLASS	"smbus_host_ctl"
 #define ACPI_SMB_HC_DEVICE_NAME	"ACPI SMBus HC"
 
 struct acpi_smb_hc {