This is an automated email from Gerrit.

Paul Fertser (fercer...@gmail.com) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/1970

-- gerrit

commit d63a1392e13ee0c5830af0c84c7c17743d830cb9
Author: Paul Fertser <fercer...@gmail.com>
Date:   Tue Feb 25 21:22:11 2014 +0400

    flash/nor/tcl: fix segfault on write_image misuse
    
    "flash write_image (unlock|erase)" (without filename) was causing
    segmentation fault in strcmp(). This patch fixes it.
    
    Change-Id: Ia3b8c796f4107621d78605c02d2b8e123b1b207b
    Reported-by: ajkroll][ <ajkroll][@irc.freenode.net>
    Signed-off-by: Paul Fertser <fercer...@gmail.com>

diff --git a/src/flash/nor/tcl.c b/src/flash/nor/tcl.c
index 916ebf7..32a666c 100644
--- a/src/flash/nor/tcl.c
+++ b/src/flash/nor/tcl.c
@@ -349,14 +349,11 @@ COMMAND_HANDLER(handle_flash_write_image_command)
 
        int retval;
 
-       if (CMD_ARGC < 1)
-               return ERROR_COMMAND_SYNTAX_ERROR;
-
        /* flash auto-erase is disabled by default*/
        int auto_erase = 0;
        bool auto_unlock = false;
 
-       for (;; ) {
+       while (CMD_ARGC) {
                if (strcmp(CMD_ARGV[0], "erase") == 0) {
                        auto_erase = 1;
                        CMD_ARGV++;

-- 

------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to