aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sound/soc/fsl/fsl_asrc.c
diff options
context:
space:
mode:
authorDaniel Mack <daniel@zonque.org>2014-10-19 09:07:36 +0200
committerMark Brown <broonie@kernel.org>2014-10-22 11:38:01 +0100
commit6aa256b6c680245b4c402f2c8a8ee356f03df3ea (patch)
treecb8faa364e6f8406173ee1abc486198af9d1104f /sound/soc/fsl/fsl_asrc.c
parentLinux 3.18-rc1 (diff)
downloadwireguard-linux-6aa256b6c680245b4c402f2c8a8ee356f03df3ea.tar.xz
wireguard-linux-6aa256b6c680245b4c402f2c8a8ee356f03df3ea.zip
ASoC: fsl: use strncpy() to prevent copying of over-long names
Use strncpy() instead of strcpy(). That's not a security issue, as the source buffer is taken from DT nodes, but we should still enforce bound checks. Spotted by Coverity. Signed-off-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/fsl/fsl_asrc.c')
-rw-r--r--sound/soc/fsl/fsl_asrc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c
index 3b145313f93e..ed866e9a2928 100644
--- a/sound/soc/fsl/fsl_asrc.c
+++ b/sound/soc/fsl/fsl_asrc.c
@@ -792,7 +792,7 @@ static int fsl_asrc_probe(struct platform_device *pdev)
return -ENOMEM;
asrc_priv->pdev = pdev;
- strcpy(asrc_priv->name, np->name);
+ strncpy(asrc_priv->name, np->name, sizeof(asrc_priv->name) - 1);
/* Get the addresses and IRQ */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);