mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2025-12-10 07:44:53 +01:00
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>
This commit is contained in:
parent
0144caf22c
commit
14f66d65a3
1 changed files with 1 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue