Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPI: EC: Use strscpy() instead of strcpy()

Replace strcpy() with strscpy() in the ACPI EC driver.

strcpy() has been deprecated because it is generally unsafe, so it
is better to eliminate it from the kernel source.

Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: Muhammad Qasim Abdul Majeed <qasim.majeed20@gmail.com>
Link: https://patch.msgid.link/20240915183822.34588-2-qasim.majeed20@gmail.com
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Muhammad Qasim Abdul Majeed and committed by
Rafael J. Wysocki
f098bb55 0151814c

+2 -2
+2 -2
drivers/acpi/ec.c
··· 1677 1677 struct acpi_ec *ec; 1678 1678 int ret; 1679 1679 1680 - strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME); 1681 - strcpy(acpi_device_class(device), ACPI_EC_CLASS); 1680 + strscpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME); 1681 + strscpy(acpi_device_class(device), ACPI_EC_CLASS); 1682 1682 1683 1683 if (boot_ec && (boot_ec->handle == device->handle || 1684 1684 !strcmp(acpi_device_hid(device), ACPI_ECDT_HID))) {