Re: [PATCH] hwmon: acpi_power_meter: replace deprecated strcpy() with strscpy()

From: Guenter Roeck
Date: Mon Apr 14 2025 - 18:41:15 EST


On 4/14/25 15:01, Yacov Simhony wrote:
Use strscpy() instead of strcpy() to prevent potential buffer overflows
in acpi_device_name() and acpi_device_class(), which point to fixed-size
buffers.

This change improves safety and aligns with current kernel cleanup efforts.

ACPI_POWER_METER_DEVICE_NAME and ACPI_POWER_METER_CLASS are constant strings.
There is no danger of buffer overflows. There is no safety improvement.

We should concentrate on fixing real problems, not imaginary ones.

Guenter