Skip to content
Snippets Groups Projects
Commit 14f66d65 authored by Tang Yuantian's avatar Tang Yuantian Committed by Tom Rini
Browse files

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: default avatarTang Yuantian <Yuantian.Tang@freescale.com>
parent 0144caf2
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment