[PATCH] board: freescale: lx2160a: fix out of bounds write

Cosmin-Florin Aluchenesei aluchenesei.cosmin-florin at nxp.com
Thu Sep 2 13:48:49 CEST 2021


The declaration of dpmac_str was changed in order to make the following
sprintf safe: sprintf(dpmac_str, "ethernet@%x", dpmac_id).

Signed-off-by: Cosmin-Florin Aluchenesei <aluchenesei.cosmin-florin at nxp.com>
---
 board/freescale/lx2160a/eth_lx2160ardb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/freescale/lx2160a/eth_lx2160ardb.c b/board/freescale/lx2160a/eth_lx2160ardb.c
index 30a3af9f47..f3b33940e3 100644
--- a/board/freescale/lx2160a/eth_lx2160ardb.c
+++ b/board/freescale/lx2160a/eth_lx2160ardb.c
@@ -233,7 +233,7 @@ void reset_phy(void)
 
 static int fdt_get_dpmac_node(void *fdt, int dpmac_id)
 {
-	char dpmac_str[] = "dpmacs at 00";
+	char dpmac_str[11] = "dpmacs at 00";
 	int offset, dpmacs_offset;
 
 	/* get the dpmac offset */
-- 
2.21.0



More information about the U-Boot mailing list