This is an automated email from Gerrit.

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

-- gerrit

commit a96e493861fa76104f3ab6d96a6272abf8b93f21
Author: xuguangxiao <[email protected]>
Date:   Tue Oct 23 15:43:11 2018 +0800

    array boundary overflow
    
    The for loop inside bitq_path_move function is not correct, this will 
overflow the cmd->path array and produces an unpredictable result.
    
    Change-Id: I81e3bc9ee6d1dd948acd2fe4c667103ac22bb26f
    Signed-off-by: xuguangxiao <[email protected]>

diff --git a/src/jtag/drivers/bitq.c b/src/jtag/drivers/bitq.c
index 66285f7..55dfe0a 100644
--- a/src/jtag/drivers/bitq.c
+++ b/src/jtag/drivers/bitq.c
@@ -123,7 +123,7 @@ static void bitq_path_move(struct pathmove_command *cmd)
 {
        int i;
 
-       for (i = 0; i <= cmd->num_states; i++) {
+       for (i = 0; i < cmd->num_states; i++) {
                if (tap_state_transition(tap_get_state(), false) == 
cmd->path[i])
                        bitq_io(0, 0, 0);
                else if (tap_state_transition(tap_get_state(), true) == 
cmd->path[i])

-- 


_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to