mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 22:52:19 +02:00
asus-laptop: prefer strscpy() over strcpy()
The function strcpy() is depreciated and potentially unsafe. It performs
no bounds checking on the destination buffer. This could result in
linear overflows beyond the end of the buffer, leading to all kinds of
misbehaviors. The safe replacement is strscpy() [1].
this fixes checkpatch warning:
WARNING: Prefer strscpy over strcpy
Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy [1]
Signed-off-by: Abdul Rahim <abdul.rahim@myyahoo.com>
Reviewed-by: Luke D. Jones <luke@ljones.dev>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20241009230558.51892-1-abdul.rahim@myyahoo.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
This commit is contained in:
parent
d12586e107
commit
8150408bfd
|
|
@ -1832,8 +1832,8 @@ static int asus_acpi_add(struct acpi_device *device)
|
|||
if (!asus)
|
||||
return -ENOMEM;
|
||||
asus->handle = device->handle;
|
||||
strcpy(acpi_device_name(device), ASUS_LAPTOP_DEVICE_NAME);
|
||||
strcpy(acpi_device_class(device), ASUS_LAPTOP_CLASS);
|
||||
strscpy(acpi_device_name(device), ASUS_LAPTOP_DEVICE_NAME);
|
||||
strscpy(acpi_device_class(device), ASUS_LAPTOP_CLASS);
|
||||
device->driver_data = asus;
|
||||
asus->device = device;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user