From: Antonio Borneo Date: Fri, 31 Dec 2010 11:18:11 +0000 (+0800) Subject: NAND/TCL: fix segfault on syntax error X-Git-Tag: v0.5.0-rc1~246 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=21a1c6ec33f87b6285e47ad6597cd49ad89a9485;p=openocd NAND/TCL: fix segfault on syntax error Fix segfault if incomplete command "nand device dummy" is executed. Signed-off-by: Antonio Borneo --- diff --git a/src/flash/nand/tcl.c b/src/flash/nand/tcl.c index af91fc89..70584fff 100644 --- a/src/flash/nand/tcl.c +++ b/src/flash/nand/tcl.c @@ -572,7 +572,7 @@ static COMMAND_HELPER(create_nand_device, const char *bank_name, COMMAND_HANDLER(handle_nand_device_command) { - if (CMD_ARGC < 1) + if (CMD_ARGC < 2) { LOG_ERROR("incomplete nand device configuration"); return ERROR_FLASH_BANK_INVALID;