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

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

Replace strcpy() with strscpy() in the ACPI event 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-3-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
e7eb88e3 f098bb55

+2 -2
+2 -2
drivers/acpi/event.c
··· 28 28 { 29 29 struct acpi_bus_event event; 30 30 31 - strcpy(event.device_class, dev->pnp.device_class); 32 - strcpy(event.bus_id, dev->pnp.bus_id); 31 + strscpy(event.device_class, dev->pnp.device_class); 32 + strscpy(event.bus_id, dev->pnp.bus_id); 33 33 event.type = type; 34 34 event.data = data; 35 35 return (blocking_notifier_call_chain(&acpi_chain_head, 0, (void *)&event)