Skip to contentSkip to conversation

disk/part.c: fix potential stack overflow bug

PATCH New Lei Wen 2 participants 2 messages Feb 15, 2011 – Apr 12, 2011

lore
Share & tools
lore

Lei Wen

author
#0 lore raw

PATCH 1/1 disk/part.c: fix potential stack overflow bug

If the param pass to get_dev is not the one defined in the block_drvr, it could make uboot becomes unstable, for it would continue run after search complete the block_drvr table.

---
 disk/part.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
disk/part.c +1 -1
index 13723f2..f07a17f 100644
@@ -84,7 +84,7 @@ block_dev_desc_t *get_dev(char* ifname, int dev)
 #ifdef CONFIG_NEEDS_MANUAL_RELOC
 	name += gd->reloc_off;
 #endif
-	while (name) {
+	while (drvr->name) {
 		name = drvr->name;
 		reloc_get_dev = drvr->get_dev;
 #ifdef CONFIG_NEEDS_MANUAL_RELOC
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 1/1 disk/part.c: fix potential stack overflow bug

Dear Lei Wen,

Quoted 8 lines · In message <[email protected]> you wrote:

If the param pass to get_dev is not the one defined in the block_drvr, it could make uboot becomes unstable, for it would continue run after search complete the block_drvr table.

---
 disk/part.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The Gates in my computer are AND, OR and NOT; they are not Bill.