From 5a19b361e419764ef96c5059a5342ca2d8570e60 Mon Sep 17 00:00:00 2001 From: Jie Zhang Date: Mon, 13 Oct 2008 08:28:02 +0000 Subject: [PATCH] [ 2161732 ] valgrind check error git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1375 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/ChangeLog | 5 +++++ jtag/src/tap/cable/ft2232.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/jtag/ChangeLog b/jtag/ChangeLog index 8a61f8a8..def7dc8a 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,8 @@ +2008-10-13 Jie Zhang + + * src/tap/cable/ft2232.c (ft2232_transfer_schedule): Don't + access memory out of bounds. + 2008-10-11 Arnim Laeuger * src/bus/ejtag.c (ejtag_bus_init): added remaining return values diff --git a/jtag/src/tap/cable/ft2232.c b/jtag/src/tap/cable/ft2232.c index 01b2b553..78866cc1 100644 --- a/jtag/src/tap/cable/ft2232.c +++ b/jtag/src/tap/cable/ft2232.c @@ -1052,7 +1052,7 @@ ft2232_transfer_schedule( cable_t *cable, int len, char *in, char *out ) { int bit_idx; unsigned char b = 0; - for (bit_idx = 1; bit_idx <= 1 << bitwise_len; bit_idx <<= 1) + for (bit_idx = 1; bit_idx < 1 << bitwise_len; bit_idx <<= 1) { if (in[in_offset++]) b |= bit_idx;