aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Fritiofson <andreas.fritiofson@gmail.com>2013-07-10 19:22:42 +0200
committerSpencer Oliver <spen@spen-soft.co.uk>2013-08-01 10:31:14 +0000
commit209e0beed384a5401158cd0c06add3590e0109dc (patch)
tree2f4fabc5d863a64a5d0c2b9d1ffd00fe8ad6800d /src
parentc979a08144ddea266fbf626182b5a06ad90e9ea8 (diff)
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 <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1500 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/jtag/drivers/mpsse.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/jtag/drivers/mpsse.c b/src/jtag/drivers/mpsse.c
index 59927a0f..c5fd6d7f 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);