[PATCH] board/km/cent2: Fix buffer overflow when fixing MAC address

Francois Berder fberder at outlook.fr
Fri Sep 29 16:11:00 CEST 2023


String "/soc/fman/ethernet at e8000" is 25 bytes long
and not 24 due to extra byte for null character at
the end.

Signed-off-by: Francois Berder <fberder at outlook.fr>
---
 board/keymile/kmcent2/kmcent2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/keymile/kmcent2/kmcent2.c b/board/keymile/kmcent2/kmcent2.c
index ed552c57b5..cd3a649c16 100644
--- a/board/keymile/kmcent2/kmcent2.c
+++ b/board/keymile/kmcent2/kmcent2.c
@@ -291,7 +291,7 @@ int last_stage_init(void)
 void fdt_fixup_fman_mac_addresses(void *blob)
 {
 	int node, ret;
-	char path[24];
+	char path[25];
 	unsigned char mac_addr[6];
 
 	/*
-- 
2.34.1



More information about the U-Boot mailing list