From fb9a43d93e302fcde5b9d7acb6ecafc4bf9d7171 Mon Sep 17 00:00:00 2001 From: Palmer Dabbelt Date: Fri, 1 Jun 2018 00:30:11 -0700 Subject: [PATCH] Zero the input buffer --- src/target/riscv/riscv-013.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c index 3d00d2991..547b01f33 100644 --- a/src/target/riscv/riscv-013.c +++ b/src/target/riscv/riscv-013.c @@ -2024,6 +2024,8 @@ static int read_memory_progbuf(struct target *target, target_addr_t address, select_dmi(target); + memset(buffer, 0, count*size); + /* s0 holds the next address to write to * s1 holds the next data value to write */