From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Thu, 7 Jun 2012 12:27:40 -0500 Subject: [U-Boot] [PATCH] cmd_nand: fix crashing bug in nand read/write In-Reply-To: <1339089558-22806-1-git-send-email-steve@sakoman.com> References: <1339089558-22806-1-git-send-email-steve@sakoman.com> Message-ID: <4FD0E48C.2060400@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 06/07/2012 12:19 PM, Steve Sakoman wrote: > Commit 418396e212b59bf907dbccad997ff50f7eb61b16 introduced a > bug that causes nand read and nand write to crash in strcmp > due to a null pointer. > > Root cause is that strchr(cmd, '.') returns a null pointer when > the input string does not contain a '.' > > The strcmp function does not check for null pointers, resulting > in a crash. > > Signed-off-by: Steve Sakoman Applied to u-boot-nand-flash, thanks! This was missed in testing because U-Boot on PowerPC unfortunately has a valid mapping at NULL. -Scott