target/riscv: Add null pointer check before right shift for bscan tunneling. 14/7814/3
authoreolson <erin.olson@seagate.com>
Thu, 22 Jun 2023 18:02:21 +0000 (13:02 -0500)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 22 Jul 2023 20:16:11 +0000 (20:16 +0000)
Change-Id: I5d4764c777f33d48705b3e5273eb840c13cfbfb7
Signed-off-by: eolson <erin.olson@seagate.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7814
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
src/target/riscv/batch.c

index 8ec043efb734fa6800d7176f38c81beb7ea6934f..d39967e4dfe8bc0e3cf4f7873833237b09c2e4f4 100644 (file)
@@ -115,8 +115,10 @@ int riscv_batch_run(struct riscv_batch *batch)
 
        if (bscan_tunnel_ir_width != 0) {
                /* need to right-shift "in" by one bit, because of clock skew between BSCAN TAP and DM TAP */
-               for (size_t i = 0; i < batch->used_scans; ++i)
-                       buffer_shr((batch->fields + i)->in_value, DMI_SCAN_BUF_SIZE, 1);
+               for (size_t i = 0; i < batch->used_scans; ++i) {
+                       if ((batch->fields + i)->in_value)
+                               buffer_shr((batch->fields + i)->in_value, DMI_SCAN_BUF_SIZE, 1);
+               }
        }
 
        for (size_t i = 0; i < batch->used_scans; ++i)

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)