From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Dyer Date: Sun, 25 Sep 2005 17:40:56 -0500 Subject: [U-Boot-Users] Re: [patch] add support for AMD Alchemy Pb1x00 boards to u-boot-1.1.2 In-Reply-To: <20050924225258.83F763529BB@atlas.denx.de> References: <1106244186.8838.23.camel@kronenbourg.scs.ch> <20050924225258.83F763529BB@atlas.denx.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 9/24/05, Wolfgang Denk wrote: > > I've also fixed the mii and usb commands which can dereference a null > > pointer when called without arguments. > > No, this is not possible. The command definition requires always at > least one argument. This part rejected. > I beg to differ - I've seen this problem also. The code in main.c:run_command() checks for more than more than a maximum but never checks a minimum number of arguments, so entering mii makes cmd_mii get called with argv[0] = 'mii' and argc = 1. main.c:parse_line() sets argv[1] to NULL. The code in cmd_mii.c assumes there will be a valid argv[1], but never checks argc before using argv[1]. This leads to an exception on machines where 0 is not a valid address (like MIPS). -- Hardware, n.: The parts of a computer system that can be kicked.