From: Lei Wen Date: Tue, 15 Feb 2011 08:56:40 +0000 (+0800) Subject: disk/part.c: fix potential stack overflow bug X-Git-Tag: v2011.06-rc1~155 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b16aadf411280fc426d7488ddd8a5b2038b7194d;p=oweals%2Fu-boot.git 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. Signed-off-by: Lei Wen --- diff --git a/disk/part.c b/disk/part.c index 13723f23b3..f07a17feb8 100644 --- a/disk/part.c +++ b/disk/part.c @@ -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