From b8df0647fd40d6724a236d6ace5c63568fca3241 Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Fri, 29 May 2020 00:04:46 +1000 Subject: [PATCH] mw_debug: Fix memory overflow with "sim" backend Signed-off-by: Benjamin Herrenschmidt --- scripts/mw_debug/mw_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/mw_debug/mw_debug.c b/scripts/mw_debug/mw_debug.c index fec9722..8999c8c 100644 --- a/scripts/mw_debug/mw_debug.c +++ b/scripts/mw_debug/mw_debug.c @@ -176,7 +176,7 @@ static int sim_command(uint8_t op, uint8_t addr, uint64_t *data) printf("\n"); } write(sim_fd, buf, p - buf); - r = read(sim_fd, buf, 127); + r = read(sim_fd, buf, sizeof(buf)); if (0 && r > 0) { int i; -- 2.30.2