summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTang Yuantian <Yuantian.Tang@freescale.com>2015-05-06 11:21:33 +0800
committerTom Rini <trini@konsulko.com>2015-05-28 08:18:24 -0400
commit14f66d65a33f622b8138ab0fcd1e18060a2355c2 (patch)
tree34988737d61abd7d8349141eee440e8323e24cd0
parent0144caf22ce6acd5c252309bf9abe6d898e8cab3 (diff)
downloadu-boot-imx-14f66d65a33f622b8138ab0fcd1e18060a2355c2.zip
u-boot-imx-14f66d65a33f622b8138ab0fcd1e18060a2355c2.tar.gz
u-boot-imx-14f66d65a33f622b8138ab0fcd1e18060a2355c2.tar.bz2
fsl/sata: Replace sprintf() with snprintf()
Function 'sprintf' does not check buffer boundaries but outputs to the buffer of fixed size which could potentially cause buffer overflow. Use a safer function to replace it. Signed-off-by: Tang Yuantian <Yuantian.Tang@freescale.com>
-rw-r--r--drivers/block/fsl_sata.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/fsl_sata.c b/drivers/block/fsl_sata.c
index 71d7cec..735708a 100644
--- a/drivers/block/fsl_sata.c
+++ b/drivers/block/fsl_sata.c
@@ -113,7 +113,7 @@ int init_sata(int dev)
/* Save the private struct to block device struct */
sata_dev_desc[dev].priv = (void *)sata;
- sprintf(sata->name, "SATA%d", dev);
+ snprintf(sata->name, 12, "SATA%d", dev);
/* Set the controller register base address to device struct */
reg = (fsl_sata_reg_t *)(fsl_sata_info[dev].sata_reg_base);