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

ASoC: Intel: atom: Replace strcpy() with strscpy()

strcpy() is deprecated; use the safer strscpy() instead.

Link: https://github.com/KSPP/linux/issues/88
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20251112202630.6277-1-thorsten.blum@linux.dev
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Thorsten Blum and committed by
Mark Brown
123cd174 4d6e2211

+3 -2
+1 -1
sound/soc/intel/atom/sst-atom-controls.c
··· 142 142 143 143 if (uinfo->value.enumerated.item > e->max - 1) 144 144 uinfo->value.enumerated.item = e->max - 1; 145 - strcpy(uinfo->value.enumerated.name, 145 + strscpy(uinfo->value.enumerated.name, 146 146 e->texts[uinfo->value.enumerated.item]); 147 147 148 148 return 0;
+2 -1
sound/soc/intel/atom/sst/sst_acpi.c
··· 12 12 #include <linux/fs.h> 13 13 #include <linux/interrupt.h> 14 14 #include <linux/slab.h> 15 + #include <linux/string.h> 15 16 #include <linux/io.h> 16 17 #include <linux/platform_device.h> 17 18 #include <linux/firmware.h> ··· 357 356 358 357 /* Fill sst platform data */ 359 358 ctx->pdata = pdata; 360 - strcpy(ctx->firmware_name, mach->fw_filename); 359 + strscpy(ctx->firmware_name, mach->fw_filename); 361 360 362 361 ret = sst_platform_get_resources(ctx); 363 362 if (ret)