aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorDaniel Mack <daniel@zonque.org>2014-10-19 03:07:36 -0400
committerMark Brown <broonie@kernel.org>2014-10-22 06:38:01 -0400
commit6aa256b6c680245b4c402f2c8a8ee356f03df3ea (patch)
treecb8faa364e6f8406173ee1abc486198af9d1104f /sound
parentf114040e3ea6e07372334ade75d1ee0775c355e1 (diff)
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')
-rw-r--r--sound/soc/fsl/fsl_asrc.c2
-rw-r--r--sound/soc/fsl/fsl_esai.c2
2 files changed, 2 insertions, 2 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)
792 return -ENOMEM; 792 return -ENOMEM;
793 793
794 asrc_priv->pdev = pdev; 794 asrc_priv->pdev = pdev;
795 strcpy(asrc_priv->name, np->name); 795 strncpy(asrc_priv->name, np->name, sizeof(asrc_priv->name) - 1);
796 796
797 /* Get the addresses and IRQ */ 797 /* Get the addresses and IRQ */
798 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 798 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
index 8bcdfda09d7a..a645e296199e 100644
--- a/sound/soc/fsl/fsl_esai.c
+++ b/sound/soc/fsl/fsl_esai.c
@@ -734,7 +734,7 @@ static int fsl_esai_probe(struct platform_device *pdev)
734 return -ENOMEM; 734 return -ENOMEM;
735 735
736 esai_priv->pdev = pdev; 736 esai_priv->pdev = pdev;
737 strcpy(esai_priv->name, np->name); 737 strncpy(esai_priv->name, np->name, sizeof(esai_priv->name) - 1);
738 738
739 /* Get the addresses and IRQ */ 739 /* Get the addresses and IRQ */
740 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 740 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);