This is an automated email from Gerrit.

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

-- gerrit

commit 5d1be29f198debf47a7c0c1872fab0a4eae479e6
Author: Andreas Fritiofson <[email protected]>
Date:   Wed Jul 10 19:22:42 2013 +0200

    mpsse: Add missing read buffer checks
    
    These two unused functions added reads without checking for available
    space.
    
    Change-Id: I17dbbe9988b057e5a3a1768f405fc9d1027d1c01
    Signed-off-by: Andreas Fritiofson <[email protected]>

diff --git a/src/jtag/drivers/mpsse.c b/src/jtag/drivers/mpsse.c
index 59927a0..c5fd6d7 100644
--- a/src/jtag/drivers/mpsse.c
+++ b/src/jtag/drivers/mpsse.c
@@ -602,7 +602,7 @@ void mpsse_read_data_bits_low_byte(struct mpsse_ctx *ctx, 
uint8_t *data)
                return;
        }
 
-       if (buffer_write_space(ctx) < 1)
+       if (buffer_write_space(ctx) < 1 || buffer_read_space(ctx) < 1)
                ctx->retval = mpsse_flush(ctx);
 
        buffer_write_byte(ctx, 0x81);
@@ -618,7 +618,7 @@ void mpsse_read_data_bits_high_byte(struct mpsse_ctx *ctx, 
uint8_t *data)
                return;
        }
 
-       if (buffer_write_space(ctx) < 1)
+       if (buffer_write_space(ctx) < 1 || buffer_read_space(ctx) < 1)
                ctx->retval = mpsse_flush(ctx);
 
        buffer_write_byte(ctx, 0x83);

-- 

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to