From 0fbdfba97b5d556a62843f67af6bbe0c3fc28e21 Mon Sep 17 00:00:00 2001 From: Kolja Waschk Date: Mon, 22 Dec 2008 00:39:13 +0000 Subject: [PATCH] Fix for SVF tdo comparison flaw (2456021) git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1410 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/ChangeLog | 2 ++ jtag/src/svf/svf.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/jtag/ChangeLog b/jtag/ChangeLog index 2ea1ddbe..7584b6c1 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,5 +1,7 @@ 2008-12-21 Kolja Waschk + * src/svf/svf.c: Fix 2456021 - SVF compare_tdo flaw + * src/tap/cable/ft2232.c, src/tap/cable/cmd_xfer.c, src/tap/cable/cmd_xfer.h: limit maximum number of bytes queued into one cmd buffer. Should fix problems with high clocks count for diff --git a/jtag/src/svf/svf.c b/jtag/src/svf/svf.c index bfb78d57..61b68d15 100644 --- a/jtag/src/svf/svf.c +++ b/jtag/src/svf/svf.c @@ -437,7 +437,7 @@ svf_compare_tdo(parser_priv_t *priv, char *tdo, char *mask, tap_register *reg, Y mismatch = -1; for (pos = 0; pos < reg->len; pos++) - if ((svf_hex2dec(tdo_bit[pos]) ^ reg->string[pos]) & svf_hex2dec(mask_bit[pos])) + if ((tdo_bit[pos] != reg->string[pos]) && (mask_bit[pos] == '1')) mismatch = pos; if (mismatch >= 0) {