Skip to contentSkip to conversation

cpu/ppc4xx/fdt.c: avoid strcpy() to constant string

PATCH New y at denx.de 2 participants 2 messages Oct 20, 2009 – Oct 23, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpu/ppc4xx/fdt.c: avoid strcpy() to constant string

From: Wolfgang Denk <[email protected]>

strcpy() was iused with the target address being a pointer to a constant string, which potentially is read-only. Use a (writable) array of characters instead.

---
 cpu/ppc4xx/fdt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
cpu/ppc4xx/fdt.c +1 -1
index 496e028..b310832 100644
@@ -42,7 +42,7 @@ void __ft_board_setup(void *blob, bd_t *bd)
 	u32 bxcr;
 	u32 ranges[EBC_NUM_BANKS * 4];
 	u32 *p = ranges;
-	char *ebc_path = "/plb/opb/ebc";
+	char ebc_path[] = "/plb/opb/ebc";
 
 	ft_cpu_setup(blob, bd);
 
Signature · 1 line
1.6.2.5
#1 lore raw

PATCH 1/1 cpu/ppc4xx/fdt.c: avoid strcpy() to constant string

Quoted 3 lines · On Tuesday 20 October 2009 23:12:13 y at denx.de wrote:

strcpy() was iused with the target address being a pointer to a constant string, which potentially is read-only. Use a (writable) array of characters instead.

Applied to u-boot-ppc4xx/master. Thanks.

Cheers,
Stefan

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de