This is an automated email from Gerrit.

Paul Fertser ([email protected]) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/1792

-- gerrit

commit a4302cf0bb9192024b056efb490453d995c752bd
Author: Paul Fertser <[email protected]>
Date:   Sun Nov 3 22:05:26 2013 +0400

    jtag: fix support for really long scans
    
    When programming large FPGAs the generated SVF files might contain really
    long SDR scans. They won't fit in the 1MiB jtag scan page at all, so in
    this case the allocated page needs to be bigger. The current code was
    silently corrupting memory.
    
    One particular example was sent by Volter targetting XC3S4000. It has an
    SDR 11316992 bits long, that is 1414624 bytes.
    
    Change-Id: I39f18d7e0654f2dbdf37df58c837c9ec1fb2aa2a
    Reported-by: "Voltner, Jiří" <[email protected]>
    Signed-off-by: Paul Fertser <[email protected]>

diff --git a/src/jtag/commands.c b/src/jtag/commands.c
index 2997d04..5e06840 100644
--- a/src/jtag/commands.c
+++ b/src/jtag/commands.c
@@ -109,7 +109,9 @@ void *cmd_queue_alloc(size_t size)
        if (!*p_page) {
                *p_page = malloc(sizeof(struct cmd_queue_page));
                (*p_page)->used = 0;
-               (*p_page)->address = malloc(CMD_QUEUE_PAGE_SIZE);
+               size_t alloc_size = (size < CMD_QUEUE_PAGE_SIZE) ?
+                                       CMD_QUEUE_PAGE_SIZE : size;
+               (*p_page)->address = malloc(alloc_size);
                (*p_page)->next = NULL;
        }
 

-- 

------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to