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

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

Replace strcpy() with strscpy() in the ACPI SBSHC 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-8-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
0dac2f74 c4ff125e

+2 -2
+2 -2
drivers/acpi/sbshc.c
··· 257 257 return -EIO; 258 258 } 259 259 260 - strcpy(acpi_device_name(device), ACPI_SMB_HC_DEVICE_NAME); 261 - strcpy(acpi_device_class(device), ACPI_SMB_HC_CLASS); 260 + strscpy(acpi_device_name(device), ACPI_SMB_HC_DEVICE_NAME); 261 + strscpy(acpi_device_class(device), ACPI_SMB_HC_CLASS); 262 262 263 263 hc = kzalloc(sizeof(struct acpi_smb_hc), GFP_KERNEL); 264 264 if (!hc)