From: Muhammad Qasim Abdul Majeed Date: Sun, 15 Sep 2024 18:38:13 +0000 (+0500) Subject: ACPI: APD: Use strscpy() instead of strcpy() X-Git-Tag: v6.13-rc1~192^2^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0151814c4c60c8e789f4f764037a19bce0a5632a;p=thirdparty%2Flinux.git ACPI: APD: Use strscpy() instead of strcpy() Replace strcpy() with strscpy() in the ACPI APD 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 Link: https://patch.msgid.link/20240915183822.34588-1-qasim.majeed20@gmail.com [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c index 800f978684481..49539f7528c64 100644 --- a/drivers/acpi/acpi_apd.c +++ b/drivers/acpi/acpi_apd.c @@ -86,7 +86,7 @@ static int fch_misc_setup(struct apd_private_data *pdata) if (!clk_data->name) return -ENOMEM; - strcpy(clk_data->name, obj->string.pointer); + strscpy(clk_data->name, obj->string.pointer, obj->string.length); } else { /* Set default name to mclk if entry missing in firmware */ clk_data->name = "mclk";