diff options
author | Sachin Mokashi <sachin.mokashi@intel.com> | 2025-06-13 12:35:30 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2025-06-16 13:26:45 +0100 |
commit | 47972c1c3315672352f25c68f91dd88543541947 (patch) | |
tree | 242c31e5b08dc218e367f5f2b30d23c22a79d016 | |
parent | e7af416aebb36e6681b9c6950d0f6352aee7c084 (diff) |
ASoC: Intel: Replace deprecated strcpy() with strscpy()
strcpy() is deprecated, use strscpy() instead.
As strcpy() performs no bounds checking on the destination buffer. This
could result in buffer overflow. The safe replacement is strscpy().
Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: Sachin Mokashi <sachin.mokashi@intel.com>
Link: https://patch.msgid.link/20250613163530.1165690-1-sachin.mokashi@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/intel/boards/cht_bsw_rt5672.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/intel/boards/cht_bsw_rt5672.c b/sound/soc/intel/boards/cht_bsw_rt5672.c index aaef212cf44e..54c1894ee96a 100644 --- a/sound/soc/intel/boards/cht_bsw_rt5672.c +++ b/sound/soc/intel/boards/cht_bsw_rt5672.c @@ -14,6 +14,7 @@ #include <linux/platform_device.h> #include <linux/slab.h> #include <linux/clk.h> +#include <linux/string.h> #include <sound/pcm.h> #include <sound/pcm_params.h> #include <sound/soc.h> @@ -458,7 +459,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev) if (!drv) return -ENOMEM; - strcpy(drv->codec_name, RT5672_I2C_DEFAULT); + strscpy(drv->codec_name, RT5672_I2C_DEFAULT, sizeof(drv->codec_name)); /* find index of codec dai */ for (i = 0; i < ARRAY_SIZE(cht_dailink); i++) { |