From: Shinya Kuribayashi Date: Thu, 27 Dec 2007 06:39:54 +0000 (+0900) Subject: common/cmd_mii.c: Add sanity argc check X-Git-Tag: v1.3.2-rc1~100^2~49 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b9173af73e524d37c812f210173cf83385c5171a;p=oweals%2Fu-boot.git common/cmd_mii.c: Add sanity argc check If type mii command without arguments, we suffer from uninitialized argv[] entries; for example we MIPS get stuck by TLB error. Signed-off-by: Shinya Kuribayashi --- diff --git a/common/cmd_mii.c b/common/cmd_mii.c index f530a38421..079612a4e6 100644 --- a/common/cmd_mii.c +++ b/common/cmd_mii.c @@ -438,6 +438,11 @@ int do_mii (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) int rcode = 0; char *devname; + if (argc < 2) { + printf("Usage:\n%s\n", cmdtp->usage); + return 1; + } + #if defined(CONFIG_8xx) || defined(CONFIG_MCF532x) mii_init (); #endif